blob: 13ce053784c2fc62732d9b4818a6013157dfdae6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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');
});
|