diff options
Diffstat (limited to 'tests/lib/mocha-3.1.0/test/acceptance/misc/many.spec.js')
-rw-r--r-- | tests/lib/mocha-3.1.0/test/acceptance/misc/many.spec.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/lib/mocha-3.1.0/test/acceptance/misc/many.spec.js b/tests/lib/mocha-3.1.0/test/acceptance/misc/many.spec.js new file mode 100644 index 0000000000..26538bc66e --- /dev/null +++ b/tests/lib/mocha-3.1.0/test/acceptance/misc/many.spec.js @@ -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(); + } + +}) |