Browse Source

Fix neotest-phpunit and add some test keybinds

master
parent
commit
a3b66e473e
1 changed files with 15 additions and 9 deletions
  1. +15
    -9
      .config/nvim/lua/config/neotest.lua

+ 15
- 9
.config/nvim/lua/config/neotest.lua View File

@ -1,16 +1,22 @@
require("neotest").setup({
local neotest = require('neotest')
vim.keymap.set('n', '<leader>tr', function () neotest.run.run() end)
vim.keymap.set('n', '<leader>tR', function () neotest.run.run_last() end)
vim.keymap.set('n', '<leader>tf', function () neotest.run.run(vim.fn.expand('%')) end)
vim.keymap.set('n', '<leader>tS', function () neotest.run.stop() end)
vim.keymap.set('n', '<leader>ta', function () neotest.run.attach() end)
vim.keymap.set('n', '<leader>to', function () neotest.output.open() end)
vim.keymap.set('n', '<leader>ts', function () neotest.summary.toggle() end)
neotest.setup({
adapters = { adapters = {
require("neotest-phpunit")({ require("neotest-phpunit")({
root_files = { "phpunit.xml", "composer.json" }, root_files = { "phpunit.xml", "composer.json" },
phpunit_cmd = { "docker-compose exec fpm ./vendor/bin/phpunit" },
filter_dirs = { "vendor" }
phpunit_cmd = { "docker-compose", "exec", "fpm", "./vendor/bin/phpunit" },
filter_dirs = { "vendor" },
mapped_docker_dir = "/var/www",
append_to_cwd = '/api'
}), }),
}, },
}) })
require("neotest-phpunit")({
root_files = { "phpunit.xml", "composer.json" },
phpunit_cmd = { "docker-compose", "exec", "fpm", "./vendor/bin/phpunit" },
-- phpunit_cmd = { "vendor/bin/phpunit" },
filter_dirs = { "vendor" }
})

Loading…
Cancel
Save