return { "nvim-neotest/neotest", dependencies = { "antoinemadec/FixCursorHold.nvim", "nvim-neotest/neotest-python", "nvim-neotest/neotest-jest", "marilari88/neotest-vitest", { "stevanfreeborn/neotest-playwright", branch = "fork" }, "issafalcon/neotest-dotnet", { "stevanfreeborn/neotest-go" }, }, config = function() local neotest = require("neotest") -- local neotest_ns = vim.api.nvim_create_namespace("neotest") -- -- vim.diagnostic.config({ -- virtual_text = { -- format = function(diagnostic) -- local message = diagnostic.message:gsub("\n", " "):gsub("\t", " "):gsub("%s+", " "):gsub("^%s+", "") -- return message -- end, -- }, -- }, neotest_ns) neotest.setup({ log_level = vim.log.levels.DEBUG, summary = { follow = false, }, adapters = { require("neotest-python"), require("neotest-jest"), require("neotest-vitest"), require("neotest-playwright").adapter({ options = { persist_project_selection = true, enable_dynamic_test_discovery = true, preset = "headed", experimental = { telescope = { enabled = true, }, }, get_playwright_binary = function() return vim.loop.cwd() .. "/node_modules/.bin/playwright" end, }, }), require("neotest-dotnet")({ dap = { adapter_name = "coreclr", }, discovery_root = "solution", }), require("neotest-go"), }, }) vim.keymap.set("n", "tr", neotest.run.run, { desc = "Run nearest test" }) vim.keymap.set("n", "td", function() neotest.run.run({ strategy = "dap" }) end, { desc = "Debug nearest test" }) vim.keymap.set("n", "ts", neotest.run.stop, { desc = "Stop nearest test" }) vim.keymap.set("n", "tf", function() neotest.run.run(vim.fn.expand("%")) end, { desc = "Run file tests" }) vim.keymap.set("n", "to", neotest.output.open, { desc = "Display output" }) vim.keymap.set("n", "top", neotest.output_panel.open, { desc = "Display output panel" }) vim.keymap.set("n", "topc", neotest.output_panel.clear, { desc = "Clear output" }) vim.keymap.set("n", "", neotest.summary.open, { desc = "Display summary" }) vim.keymap.set("n", "tsr", neotest.summary.run_marked, { desc = "Run marked tests" }) vim.keymap.set("n", "tsc", neotest.summary.clear_marked, { desc = "Clear marked tests" }) vim.keymap.set("n", "tw", neotest.watch.watch, { desc = "Start watching tests" }) vim.keymap.set("n", "twc", neotest.watch.stop, { desc = "Stop watching tests" }) end, }