mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
feat(dap): add jest and vitest config
This commit is contained in:
parent
01fbeb139b
commit
512c238763
1 changed files with 43 additions and 19 deletions
|
|
@ -92,8 +92,7 @@ return {
|
|||
},
|
||||
}
|
||||
end
|
||||
for _, language in ipairs({ "typescript", "javascript" }) do
|
||||
if not dap.configurations[language] then
|
||||
for _, language in ipairs({ "typescript", "typescriptreact", "javascript", "javascriptreact" }) do
|
||||
dap.configurations[language] = {
|
||||
{
|
||||
type = "pwa-node",
|
||||
|
|
@ -109,9 +108,34 @@ return {
|
|||
processId = require("dap.utils").pick_process,
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
{
|
||||
type = "pwa-node",
|
||||
request = "launch",
|
||||
name = "Launch test file (pwa-node with jest)",
|
||||
cwd = vim.fn.getcwd(),
|
||||
runtimeArgs = { "${workspaceFolder}/node_modules/.bin/jest" },
|
||||
runtimeExecutable = "node",
|
||||
args = { "${file}", "--coverage", "false" },
|
||||
rootPath = "${workspaceFolder}",
|
||||
sourceMaps = true,
|
||||
console = "integratedTerminal",
|
||||
internalConsoleOptions = "neverOpen",
|
||||
skipFiles = { "<node_internals>/**", "node_modules/**" },
|
||||
},
|
||||
{
|
||||
type = "pwa-node",
|
||||
request = "launch",
|
||||
name = "Launch test file (pwa-node with vitest)",
|
||||
cwd = vim.fn.getcwd(),
|
||||
program = "${workspaceFolder}/node_modules/vitest/vitest.mjs",
|
||||
args = { "--inspect-brk", "--threads", "false", "run", "${file}" },
|
||||
autoAttachChildProcesses = true,
|
||||
smartStep = true,
|
||||
console = "integratedTerminal",
|
||||
skipFiles = { "<node_internals>/**", "node_modules/**" },
|
||||
},
|
||||
}
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue