feat(nvim): add neotest plugin

This commit is contained in:
Stefan Imhoff
2023-06-30 13:28:30 +02:00
parent c984f0ca78
commit 8c12fc4bd3
4 changed files with 55 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ require("lazy").setup({
{ import = "lazyvim.plugins.extras.lang.typescript" },
{ import = "lazyvim.plugins.extras.lang.json" },
{ import = "lazyvim.plugins.extras.ui.mini-animate" },
{ import = "lazyvim.plugins.extras.test.core" },
-- import/override with your plugins
{ import = "plugins" },
},

View File

@@ -0,0 +1,50 @@
-- Neotest
-- https://github.com/nvim-neotest/neotest
return {
{
"nvim-neotest/neotest",
dependencies = {
"haydenmeade/neotest-jest",
"marilari88/neotest-vitest",
},
keys = {
{
"<leader>tl",
function()
require("neotest").run.run_last()
end,
desc = "Run Last Test",
},
{
"<leader>tL",
function()
require("neotest").run.run_last({
strategy = "dap",
})
end,
desc = "Debug Last Test",
},
{
"<leader>tw",
"<cmd>lua require('neotest').run.run({ jestCommand = 'jest --watch ' })<cr>",
desc = "Run Watch",
},
},
opts = function(_, opts)
table.insert(
opts.adapters,
require("neotest-jest")({
jestCommand = "npm test --",
jestConfigFile = "custom.jest.config.ts",
env = {
CI = true,
},
cwd = function()
return vim.fn.getcwd()
end,
})
)
table.insert(opts.adapters, require("neotest-vitest"))
end,
},
}