caolan / caolan/nodeunit

Undone tests fail silently when using the JUnit reporter

Open
#157 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.9k
Forks
359
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.