Closed bmulholland closed 2 years ago
I hadn't actually used the output window except for failing tests (which should look quite reasonable) and you're quite right, it is "human-unfriendly".
I think we can get around this by specifying multiple formats in the command such as bundle exec rspec -f json -o output.json -f progress spec/simple_example_spec.rb
. I'll look into this later today
I did try a failing test too -- there was a nice output view that popped up automatically, but if I manually opened test output with the neotest command, JSON was still shown. I don't understand where that initial nicely-formatted output came from, though...
It's from here:
if result.exception then
tests[test_id].short = tests[test_id].short .. '\n' .. result.exception.message
tests[test_id].errors = result.exception.backtrace
end
I think I can pass stdout to the output
key in the test results.
That makes sense. stdout to output makes sense to me, too.
Hopefully should be fixed for you:
Beautiful!
When I look at the test output, I expect to see human-friendly information about the test (and any failures): https://github.com/nvim-neotest/neotest#output-window
Instead, I see human-unfriendly JSON (rspec's JSON output, specifically).
This is a tricky one. Three options I can see:
3 is my favourite, but a good starting point is probably to check how neotest-pytest does it, considering that's the example in the README screenshot. https://github.com/nvim-neotest/neotest-python