Open scottming opened 1 year ago
You can write a custom consumer for this.
neotest.setup({
consumers = {
notify = function(client)
client.listeners.results = function(adapter_id, results, partial)
-- Partial results can be very frequent
if partial then
return
end
require("neotest.lib").notify("Tests completed")
end
return {}
end,
},
You could check the results to change the message.
I'd be open to PRs for a built-in consumer with a more fleshed out API if you're interested or I may get around to implementing myself at some stage :sweat_smile:
I'm interested in what you said about a fleshed out API.
Well I'm open to ideas :smile:
Some potential niceties:
short
message if present when a single test is run. Generally if I'm running a single test, I'd like to see the result quickly so that could be a useful way of doing it.Cool, I like these ideas.
Maybe all there's needed is an example in the README. The API that's there in place along with its type hints is super clear and easy to write anything one might like, thanks @rcarriga!
I mainly run tests in the IEx shell when I develop Elixir projects, It's super fast, but it's easy to miss the notifications, so I want to use https://github.com/rcarriga/nvim-notify to notify me after the test is finished.
How do I archive this?
FYI: https://github.com/jfpedroza/neotest-elixir/pull/23