-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fix-1417-multiple-done-calls' of https://github.com/fra…
…nkleonrose/mocha into pull/2059 * 'fix-1417-multiple-done-calls' of https://github.com/frankleonrose/mocha: Fix #1417: Show actual error, not 'multiple calls to done()' # Conflicts: # test/integration/regression.js
- Loading branch information
Showing
3 changed files
with
42 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
|
||
/** | ||
* This file should generate only one failure per spec for the thrown error. | ||
* It should not report misleading 'multiple calls to done()'. | ||
*/ | ||
|
||
it('fails exactly once when a global error is thrown synchronously and done errors', function(done) { | ||
setTimeout(function() { | ||
done(new Error('test error')); | ||
}, 1); // Not 0 - it will 'succeed', but won't test the breaking condition | ||
|
||
throw new Error('sync error'); | ||
}); | ||
|
||
it('fails exactly once when a global error is thrown synchronously and done completes', function(done) { | ||
setTimeout(function() { | ||
done(); | ||
}, 1); // Not 0 - it will 'succeed', but won't test the breaking condition | ||
|
||
throw new Error('sync error'); | ||
}); |
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