-
-
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 remote-tracking branch 'remotes/mocha/master'
- Loading branch information
Showing
6 changed files
with
41 additions
and
41 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 |
---|---|---|
@@ -1,17 +1,17 @@ | ||
'use strict'; | ||
|
||
// we cannot recover gracefully if a Runnable has already passed | ||
// then fails asynchronously | ||
it('test 1', function () { | ||
console.log('testbody1'); | ||
process.nextTick(function () { | ||
throw new Error('Too bad'); | ||
}); | ||
}); | ||
|
||
it('test 2', function () { | ||
console.log('testbody2'); | ||
throw new Error('should not run - test 2'); | ||
}); | ||
|
||
it('test 3', function () { | ||
console.log('testbody3'); | ||
throw new Error('OUCH'); | ||
throw new Error('should not run - test 3'); | ||
}); |
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 |
---|---|---|
@@ -1,11 +1,22 @@ | ||
'use strict'; | ||
|
||
it('should bail if a successful test asynchronously fails', function(done) { | ||
done(); | ||
process.nextTick(function () { | ||
throw new Error('global error'); | ||
}); | ||
}); | ||
describe('fatal uncaught exception', function () { | ||
describe('first suite', function () { | ||
it('should bail if a successful test asynchronously fails', function (done) { | ||
done(); | ||
process.nextTick(function () { | ||
throw new Error('global error'); | ||
}); | ||
}); | ||
|
||
it('should not actually get run', function () { | ||
it('should not actually get run', function () { | ||
throw new Error('should never throw - first suite'); | ||
}); | ||
}); | ||
|
||
describe('second suite', function () { | ||
it('should not actually get run', function () { | ||
throw new Error('should never throw - second suite'); | ||
}); | ||
}); | ||
}); |
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