mardi 3 mars 2015

Mocha test suite halted on uncaught exception

I can't prevent an uncaught async exception from halting a suite of mocha tests. It seems like it should fail just the test, but the mocha process exits. For the given test cases:



describe('AsyncWow', () => {
it('should proceeed after this test', (done) => {
setTimeout(() => {
throw new Error('boom');
done();
});
});
it('but never gets here', (done) => {
done();
});
});


Produces terminal output:



AsyncWow

/source/test/foo.test.js:6
throw new Error('boom');
^
Error: boom
at [object Object]._onTimeout (/source/test/foo.test.js:6:16)
at Timer.listOnTimeout (timers.js:110:15)

Aucun commentaire:

Enregistrer un commentaire