Skip to main content

Neotest

Please make sure to read the neotest docs on how to add test adapters.

Example on adding the plenary test adapter:

~/.config/nvim/lua/plugins/test.lua
return {
{ "nvim-neotest/neotest-plenary" },
{
"nvim-neotest/neotest",
opts = { adapters = { "neotest-plenary" } },
},
}
info

You can enable the extra with the :LazyExtras command. Plugins marked as optional will only be configured if they are installed.

Alternatively, you can add it to your lazy.nvim imports
lua/config/lazy.lua
require("lazy").setup({
spec = {
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
{ import = "lazyvim.plugins.extras.test.core" },
{ import = "plugins" },
},
})

Below you can find a list of included plugins and their default settings.

caution

You don't need to copy the default settings to your config. They are only shown here for reference.

neotest

opts = {
-- Can be a list of adapters like what neotest expects,
-- or a list of adapter names,
-- or a table of adapter names, mapped to adapter configs.
-- The adapter will then be automatically loaded with the config.
adapters = {},
-- Example for loading neotest-golang with a custom config
-- adapters = {
-- ["neotest-golang"] = {
-- go_test_args = { "-v", "-race", "-count=1", "-timeout=60s" },
-- dap_go_enabled = true,
-- },
-- },
status = { virtual_text = true },
output = { open_on_run = true },
quickfix = {
open = function()
if LazyVim.has("trouble.nvim") then
require("trouble").open({ mode = "quickfix", focus = false })
else
vim.cmd("copen")
end
end,
},
}

nvim-nio

opts = nil

nvim-dap (optional)

opts = nil