forked from mochajs/mocha
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request mochajs#1063 from glenjamin/sigint-abort
Gracefully exit on SIGINT * glenjamin/sigint-abort: Gracefully exit on SIGINT
- Loading branch information
Showing
3 changed files
with
51 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Useful for testing SIGINT handler | ||
// use env.big_number to tune iterations so that you have time to ctrl+c | ||
|
||
describe('a load of tests', function(){ | ||
it('should fail the first test', function(){ | ||
throw new Error('this should appear in the summary'); | ||
}) | ||
|
||
var iterations = (process.env.big_number || 1e7); | ||
function work() { | ||
var a = 0; | ||
for(var i=0; i<iterations; ++i) { | ||
a += i; | ||
} | ||
} | ||
|
||
function addTest() { | ||
it('should pass test ' + i, function(){ | ||
work(); | ||
}) | ||
} | ||
|
||
for(var i=0; i<500; ++i) { | ||
addTest(); | ||
} | ||
|
||
}) |