feat: make mocha fail if it encounters 0 tests #5981
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The basics
The details
Resolves
Proposed Changes
If mocha encounters 0 tests, it fails
Behavior Before Change
If mocha encounters 0 tests, it reports 0 failures and CI passes
Behavior After Change
If mocha encounters 0 tests, it says
1 tests failed
now and fails CI.Reason for Changes
Catches scenarios where somehow mocha configuration is broken, no tests are run, and we are blissfully unaware since CI reports no problems.
Test Coverage
Tested via commenting out all of the
goog.require
lines on index.html so none of the tests are imported. The browser shows 0 tests running, but the command line reports the 1 failure as expected.Documentation
n/a
Additional Information
n/a