mirror of
https://github.com/kogakure/dotfiles.git
synced 2026-02-03 20:25:30 +00:00
feat(nvim): add neotest plugin
This commit is contained in:
@@ -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" },
|
||||
},
|
||||
|
||||
50
nvim/lua/plugins/neotest.lua
Normal file
50
nvim/lua/plugins/neotest.lua
Normal 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,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user