From 2a3bac769045abac76395fcabb36b17b68bc42fc Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 27 May 2023 09:37:17 +0200 Subject: [PATCH] fix(neotest): support neotest adapaters that use `setup()` for custom setup --- lua/lazyvim/plugins/extras/test/core.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/test/core.lua b/lua/lazyvim/plugins/extras/test/core.lua index 28797a2c..a331cc7c 100644 --- a/lua/lazyvim/plugins/extras/test/core.lua +++ b/lua/lazyvim/plugins/extras/test/core.lua @@ -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