caolan/nodeunit — Issue #157: Undone tests fail silently when using the JUnit reporter
Author: thinkproductivity
Created: 2012-02-17 10:55:41+00:00
State: open

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.