Open pepijno opened 5 months ago
I have tried changing the order of calls to neotest.summary.open()
and neotest.run.run(vim.fn.expand('%'))
and the tests did run, even at the first try.
To clarify, I have changed the keymap to the following:
vim.keymap.set("n", "<Leader>ta", function()
neotest.run.run(vim.fn.expand("%"))
neotest.summary.open()
end, { desc = "Run all tests" })
My guess as to what is actually causing the issue would be that when the summary opens, neotest starts searching for tests, and if you try to run a test before it's done searching you won't be able to. However, that restriction does not seem necessary as one can call neotest.run.run(...)
even with the summary closed and the tests will run.
NeoVim Version
Describe the bug When having a keymap to open the summary window right before running the tests will show the message "No tests found". The second time it does run fine.
To Reproduce A minimal
minimal.lua
to reproduce which can be run as the following:Steps to reproduce the behavior:
tests/unit/client/event_spec.lua
in the neotest repo.<leader>ta
.Expected behavior Expected to have neotest run all the tests in the test file.
Logs neotest.log