Skip to content

Commit

Permalink
feat: default strategy config (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc authored Jul 25, 2022
1 parent 86bc68b commit 58c9aa9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
22 changes: 12 additions & 10 deletions doc/neotest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ neotest.setup({user_config}) *neotest.setup()*
{
adapters = {},
consumers = {},
default_strategy = "integrated",
diagnostic = {
enabled = true
},
Expand Down Expand Up @@ -147,16 +148,17 @@ neotest.Config *neotest.Config*


Fields: ~
{adapters} (neotest.Adapter[])
{consumers} (table<string, neotest.Consumer>)
{discovery} (neotest.Config.discovery)
{icons} (table<string, string>)
{highlights} (table<string, string>)
{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<string, neotest.Consumer>)
{discovery} (neotest.Config.discovery)
{icons} (table<string, string>)
{highlights} (table<string, string>)
{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*
Expand Down
2 changes: 1 addition & 1 deletion lua/neotest/client/runner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 2 additions & 0 deletions lua/neotest/config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ vim.cmd([[
---@field icons table<string, string>
---@field highlights table<string, string>
---@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
Expand Down Expand Up @@ -125,6 +126,7 @@ local default_config = {
max_width = 0.6,
options = {},
},
default_strategy = "integrated",
strategies = {
integrated = {
width = 120,
Expand Down

0 comments on commit 58c9aa9

Please sign in to comment.