You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

53 lines
1.4 KiB

return {
"nvim-neotest/neotest",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"antoinemadec/FixCursorHold.nvim",
-- Adapters
"tovijaeschke/neotest-phpunit",
"nvim-neotest/neotest-go",
},
config = function()
local neotest = require("neotest")
local keymap = vim.keymap
keymap.set("n", "<leader>tr", function()
neotest.run.run()
end, { desc = "Run neotest on current function" })
keymap.set("n", "<leader>tR", function()
neotest.run.run_last()
end, { desc = "Run neotest on most recent test" })
keymap.set("n", "<leader>tS", function()
neotest.run.stop()
end, { desc = "Stop running tests" })
keymap.set("n", "<leader>ta", function()
neotest.run.attach()
end, { desc = "Attach to the currently running test" })
keymap.set("n", "<leader>to", function()
neotest.output.open()
end, { desc = "Open the output of the test" })
keymap.set("n", "<leader>ts", function()
neotest.summary.toggle()
end, { desc = "Toggle neotest summary pane" })
neotest.setup({
adapters = {
require("neotest-phpunit")({
root_files = { "phpunit.xml", "composer.json" },
phpunit_cmd = { "docker", "compose", "exec", "fpm", "./vendor/bin/phpunit" },
-- phpunit_cmd = { "docker", "compose", "exec", "app-fpm", "./vendor/bin/phpunit" },
filter_dirs = { "vendor" },
mapped_docker_dir = "/var/www",
append_to_cwd = "/api",
}),
},
})
end,
}