Debian Codegraph @

test/integration/fixtures/uncaught/double.fixture.js

raw
1 'use strict';
2
3 /**
4 * This file should only generate one failure per spec despite the fact that
5 * Mocha is capable of detecting two distinct exceptions during test execution.
6 */
7
8 it('fails exactly once when a global error is thrown first', function (done) {
9 process.nextTick(function () {
10 throw new Error('global error');
11 });
12 });
13
14 it('fails exactly once when a global error is thrown second', function (done) {
15 process.nextTick(function () {
16 done(new Error('test error'));
17 });
18
19 process.nextTick(function () {
20 throw new Error('global error');
21 });
22 });