jfpedroza / neotest-elixir

Neotest adapter for Elixir
MIT License
38 stars 10 forks source link

No IO.inspect and the likes in the output window when assertion fails #15

Closed mracos closed 1 year ago

mracos commented 1 year ago

Hi 👋

Firstly, thank you so much for this plugin. It's what made me switch over from vim-test to neotest. 💙

Not sure if this question is a better fit here or in the neotest repo, but I don't see the output of IO.inspect (or IO.puts FWIW) on the test output window when some assertion fails. Maybe I have the wrong expectations for the output? Missing a configuration?

Screenshot 2022-11-21 at 15 17 24 Screenshot 2022-11-21 at 15 17 14

jfpedroza commented 1 year ago

ExUnit doesn't support output capture to show it on failure like Pytest does. It only supports log capture (which is supported by the adapter).

The output you see for the test on failure is not from stdout, it's from formatting the failure in an ExUnit formatter. On the other hand, for successful tests there is no output, so I set the output to the process output (if another test fails you will see it in the output of the successful test).

mracos commented 1 year ago

Oh, got it, that's a bummer 😞

Just to rule out, within the adapter, we would not be able to get the "process" output right? I assume that would be too hard 😞

Nevertheless, thank you so much for the explanation, learned something new today!

jfpedroza commented 1 year ago

We can get the process output after it finishes, and we could append it to all failing tests, but it would only work well if you disable the default ExUnit formatter, as otherwise you would see the full test output in the output of every failing test.