Closed rouge8 closed 2 years ago
No it's intended behaviour to open on successful tests.
You can use a custom consumer if you want to always show output on run
local neotest = require("neotest")
neotest.setup({
consumers = {
always_open_output = function(client)
local async = require("neotest.async")
client.listeners.results = function(adapter_id, results)
local file_path = async.fn.expand("%:p")
local row = async.fn.getpos(".")[2] - 1
local position = client:get_nearest(file_path, row, {})
if not position then
return
end
local pos_id = position:data().id
if not results[pos_id] then
return
end
neotest.output.open({ position_id = pos_id, adapter = adapter_id })
end
end,
},
...
No it's intended behaviour to open on successful tests
So it’s a bug that it’s not?
No meant to say it's not intended behaviour
consumers = { always_open_output = function(client) local async = require("neotest.async") client.listeners.results = function(adapter_id, results) local file_path = async.fn.expand("%:p") local row = async.fn.getpos(".")[2] - 1 local position = client:get_nearest(file_path, row, {}) if not position then return end local pos_id = position:data().id if not results[pos_id] then return end neotest.output.open({ position_id = pos_id, adapter = adapter_id }) end end, },
This works, thanks!
When I set
output.open_on_run = true
, I expected Neotest to open the output window after running a test, even if the test passes, but no window opened. Is this expected behavior?This is my Neotest config: