nodeunit icon indicating copy to clipboard operation
nodeunit copied to clipboard

Undone tests fail silently when using the JUnit reporter

Open thinkproductivity opened this issue 13 years ago • 0 comments

When running unit tests at the command line, using the default reporter, I get the following error in the console if there are undone tests:

FAILURES: Undone tests (or their setups/teardowns): details of my test here To fix this, make sure all tests call test.done()

However, when using the JUnit reporter, the failure is completely silent - no XML files are written. In our case, this means that our CI system (Jenkins) doesn't see the failures (or indeed any results) and hence marks the build as a success.

I would expect the results to still be written in this case, so that we can see which tests have passed and which have failed.

Note that the cause of undone tests isn't always due to the developer failing to call test.done() - in this specific case, the test.done() was in a callback within the unit test that ended up not getting called due to regression introduced in the production code being tested.

thinkproductivity avatar Feb 17 '12 10:02 thinkproductivity