Skip to content

Commit

Permalink
fix(neotest): support neotest adapaters that use setup() for custom…
Browse files Browse the repository at this point in the history
… setup
  • Loading branch information
folke committed May 27, 2023
1 parent 98e2ffc commit 2a3bac7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lua/lazyvim/plugins/extras/test/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ return {
elseif config ~= false then
local adapter = require(name)
if type(config) == "table" and not vim.tbl_isempty(config) then
adapter = adapter(config)
if adapter.setup then
adapter.setup(config)
elseif adapter.__call then
adapter(config)
else
error("Adapter " .. name .. " does not support setup")
end
end
adapters[#adapters + 1] = adapter
end
Expand Down

0 comments on commit 2a3bac7

Please sign in to comment.