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