hbenl / vscode-mocha-test-adapter

Mocha Test Adapter for the VS Code Test Explorer
MIT License
91 stars 31 forks source link

Extension Swallows Test Failures #136

Closed machineghost closed 3 years ago

machineghost commented 3 years ago

If I have a test with an error in its beforeEach, it's impossible to see that error in the extension. The test shows up as a gray square, with no output, whether I click on the text itself or the parent context(s).

If I wrap the error-causing code in a try/catch and log the error, then I can then see it: the test starts showing up as red instead, and the output is visible. But in a testing environment one isn't supposed to have to catch errors: the framework is supposed to treat them as failures.

So either Test Explorer should:

A) treat tests with failing beforeEach as if they failed B) surface the test output when a beforeEach causes a test to become "not run" (gray square)

hbenl commented 3 years ago

I've added support for failures in hooks in version 2.10.0, they are now treated just like regular test failures.