-
Notifications
You must be signed in to change notification settings - Fork 784
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Core: Decide "No tests" based on test count, not assert count
If a test has no assertions, that is generally by itself another unrelated error. But more importantly, it is configurable, and also something that we support on a per-test basis via assert.expect(0) for which there are several use cases such as when the tests only purpose is not to throw, either from your source code, or from another helper library (e.g. Sinon assertion's throwing). Previously, if your test suite composed only of such tests, or if you selective run such test only, it wrongly caused the test runner to report a global error for "No tests." Fixes #1405. Closes #1449.
- Loading branch information
Showing
6 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
QUnit.module( "Zero assertions", function() { | ||
QUnit.test( "has a test", function( assert ) { | ||
assert.expect( 0 ); | ||
|
||
// A test may expect zero assertions if its main purpose | ||
// is to ensure there are no no run-time exceptions. | ||
} ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters