mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-09 00:44:40 +02:00
feat(test): added easy way to configure adapters
This commit is contained in:
parent
78298cb134
commit
7443effe26
1 changed files with 15 additions and 0 deletions
|
@ -10,6 +10,12 @@ return {
|
|||
},
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
opts = {
|
||||
adapter_config = {
|
||||
-- ["adapter_name"] = {} -- set adapter config here
|
||||
},
|
||||
adapters = {},
|
||||
},
|
||||
config = function(_, opts)
|
||||
local neotest_ns = vim.api.nvim_create_namespace("neotest")
|
||||
vim.diagnostic.config({
|
||||
|
@ -22,6 +28,15 @@ return {
|
|||
},
|
||||
}, neotest_ns)
|
||||
|
||||
if opts.adapter_config then
|
||||
for a, adapter in ipairs(opts.adapters or {}) do
|
||||
local name = adapter.name
|
||||
if opts.adapter_config[name] then
|
||||
opts.adapters[a] = adapter(opts.adapter_config[name])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
require("neotest").setup(opts)
|
||||
end,
|
||||
-- stylua: ignore
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue