vscode-mocha-test-adapter
vscode-mocha-test-adapter copied to clipboard
Show full log in the "Mocha Tests" output channel
Currently the "Mocha Tests" output channel only shows the output captured from stdout/stderr, but this does not include the test run messages from mocha, so it's impossible to associate the messages in the output channel with the tests that generated them.
The "Mocha Tests" output channel should show a full log identical or sufficiently similar to the output you get when running mocha on the command line.
Originally requested here.
This is REALLY important, at the moment the test file shows the error:
assert.strictEqual(result, 3); // Input A expected to strictly equal input B:
but the Mocha command line output is:
1) plus1()
should return the value +1:
AssertionError [ERR_ASSERTION]: Input A expected to strictly equal input B:
+ expected - actual
- 2
+ 3
+ expected - actual
-2
+3
In the test explorer we are missing the vital information of at least the actual result + 2.
Maybe it could appear when hovering over? Cheers.
You should be able to see the full test log message by clicking the "Show Log" Code Lens (which only appears when there is a log message to show) or by clicking the failed test in the Test Explorer tree view. In both cases, a "Test Explorer" output channel containing the log of the selected test will appear. However, showing the full log when hovering over the one-line message in the test file sounds like a good idea, I will investigate this.
@hbenl Cheers! I did not spot the 'show log' button.
Another nice little update would be to have the output from the 'show log' button be in color like the Mocha command line output. Maybe it is because I have the '--reporter min' option? I am not sure, but it makes it a lot nicer to have the green and red colours :)
Thanks for the amazing extension!
@David-Else Yeah, colors would be nice, but unfortunately VS Code currently doesn't support colored text in output channels.
@hbenl I did a little looking about, and IBM seem to have something to do the job... no idea of the technicalities! Looks a bit old, maybe it would mess things up these days https://github.com/IBM-Cloud/vscode-log-output-colorizer