return { "nvim-neotest/neotest", commit = '52fca6717ef972113ddd6ca223e30ad0abb2800c', event = "VeryLazy", dependencies = { "nvim-lua/plenary.nvim", "nvim-treesitter/nvim-treesitter", "antoinemadec/FixCursorHold.nvim", "nvim-neotest/nvim-nio", -- Adapters "tovijaeschke/neotest-phpunit", "nvim-neotest/neotest-go", }, config = function() local neotest = require("neotest") local keymap = vim.keymap keymap.set("n", "tr", function() neotest.run.run() end, { desc = "Run neotest on current function" }) keymap.set("n", "tR", function() neotest.run.run_last() end, { desc = "Run neotest on most recent test" }) keymap.set("n", "tS", function() neotest.run.stop() end, { desc = "Stop running tests" }) keymap.set("n", "ta", function() neotest.run.attach() end, { desc = "Attach to the currently running test" }) keymap.set("n", "to", function() neotest.output.open() end, { desc = "Open the output of the test" }) keymap.set("n", "ts", function() neotest.summary.toggle() end, { desc = "Toggle neotest summary pane" }) vim.env.PROJECT_ROOT = vim.fn.getcwd() .. "/backend/" vim.env.ENV_PATH = vim.fn.getcwd() .. "/backend/.env" 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" }, -- phpunit_cmd = { "docker", "compose", "exec", "subscription-fpm", "./vendor/bin/phpunit" }, filter_dirs = { "vendor" }, mapped_docker_dir = "/var/www", append_to_cwd = "/api", }), require("neotest-go")({ root = function() return './backend' end, experimental = { test_table = true, }, args = { "-count=1", "-timeout=60s" }, }), -- require('neotest-jest')({ -- jestCommand = "npm test --", -- env = { CI = true }, -- cwd = function(path) -- return vim.fn.getcwd() -- end, -- }), }, }) end, }