diff --git a/doc/neotest.txt b/doc/neotest.txt index e3d4adac..61a96f21 100644 --- a/doc/neotest.txt +++ b/doc/neotest.txt @@ -47,6 +47,7 @@ neotest.setup({user_config}) *neotest.setup()* { adapters = {}, consumers = {}, + default_strategy = "integrated", diagnostic = { enabled = true }, @@ -147,16 +148,17 @@ neotest.Config *neotest.Config* Fields: ~ - {adapters} (neotest.Adapter[]) - {consumers} (table) - {discovery} (neotest.Config.discovery) - {icons} (table) - {highlights} (table) - {floating} (neotest.Config.floating) - {strategies} (neotest.Config.strategies) - {summary} (neotest.Config.summary) - {output} (neotest.Config.output) - {status} (neotest.Config.status) + {adapters} (neotest.Adapter[]) + {consumers} (table) + {discovery} (neotest.Config.discovery) + {icons} (table) + {highlights} (table) + {floating} (neotest.Config.floating) + {default_strategy} (string|function) + {strategies} (neotest.Config.strategies) + {summary} (neotest.Config.summary) + {output} (neotest.Config.output) + {status} (neotest.Config.status) neotest.Config.discovery *neotest.Config.discovery* diff --git a/lua/neotest/client/runner.lua b/lua/neotest/client/runner.lua index a35ef08d..aa56d2ab 100644 --- a/lua/neotest/client/runner.lua +++ b/lua/neotest/client/runner.lua @@ -55,7 +55,7 @@ function TestRunner:run_tree(tree, args, adapter, on_results) on_results(results) end - args = vim.tbl_extend("keep", args or {}, { strategy = "integrated" }) + args = vim.tbl_extend("keep", args or {}, { strategy = config.default_strategy }) self:_run_tree(tree, args, adapter, results_callback) diff --git a/lua/neotest/config/init.lua b/lua/neotest/config/init.lua index ecbb6581..55d09b9b 100644 --- a/lua/neotest/config/init.lua +++ b/lua/neotest/config/init.lua @@ -26,6 +26,7 @@ vim.cmd([[ ---@field icons table ---@field highlights table ---@field floating neotest.Config.floating +---@field default_strategy string | function ---@field strategies neotest.Config.strategies ---@field summary neotest.Config.summary ---@field output neotest.Config.output @@ -125,6 +126,7 @@ local default_config = { max_width = 0.6, options = {}, }, + default_strategy = "integrated", strategies = { integrated = { width = 120,