Files
neovim-config/lua/plugins/neotest.lua
T
thalladaandClaude Opus 5 cf36c2f164 Make java and neotest config portable
jdtls hardcoded /Library/Java/JavaVirtualMachines paths, which resolve to
nothing off macOS; discover JDKs across the macOS, Linux and sdkman roots
instead and only declare runtimes that exist. neotest-mocha passed `docker exec
-it`, which hangs without a TTY, and hardcoded the container name.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 12:27:20 -04:00

41 lines
1.3 KiB
Lua

return {
"nvim-neotest/neotest",
dependencies = {
"adrigzr/neotest-mocha",
},
opts = function()
return {
adapters = {
["neotest-mocha"] = {
command = "docker exec " .. (vim.env.NEOTEST_MOCHA_CONTAINER or "api-sandbox") .. " npm run test:integration",
command_args = function(context)
-- The context contains:
-- results_path: The file that json results are written to
-- test_name_pattern: The generated pattern for the test
-- path: The path to the test file
--
-- It should return a string array of arguments
--
-- Not specifying 'command_args' will use the defaults below
local relative_path = vim.fn.fnamemodify(context.path, ":.")
return {
"--full-trace",
"--reporter=json",
"--reporter-options=output=" .. context.results_path,
"--grep=" .. context.test_name_pattern,
relative_path,
}
end,
env = { CI = true, NODE_OPTIONS = "--trace-warnings --max-old-space-size=8192", NODE_ENV = "test" },
cwd = function()
return vim.fn.getcwd()
end,
},
},
consumers = {
overseer = require("neotest.consumers.overseer"),
},
}
end,
}