Skip to content

Commit

Permalink
additional test
Browse files Browse the repository at this point in the history
  • Loading branch information
juergba committed Jan 12, 2020
1 parent c35e4e9 commit e24b4b1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/integration/fixtures/uncaught/after-runner.fixture.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

describe("Uncaught exception after runner's end", () => {
it('test', () => {
setTimeout(() => {
throw new Error('Unexpected crash');
}, 100);
});
});
23 changes: 23 additions & 0 deletions test/integration/uncaught.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
var assert = require('assert');
var helpers = require('./helpers');
var run = helpers.runMochaJSON;
var runMocha = helpers.runMocha;
var args = [];

describe('uncaught exceptions', function() {
Expand Down Expand Up @@ -100,6 +101,28 @@ describe('uncaught exceptions', function() {
});
});

it("handles uncaught exceptions after runner's end", function(done) {
runMocha(
'uncaught/after-runner.fixture.js',
args,
function(err, res) {
if (err) {
return done(err);
}

expect(res, 'to have failed').and('to satisfy', {
failing: 0,
passing: 1,
pending: 0,
output: expect.it('to contain', 'Error: Unexpected crash')
});

done();
},
'pipe'
);
});

it('issue-1327: should run the first test and then bail', function(done) {
run('uncaught/issue-1327.fixture.js', args, function(err, res) {
if (err) {
Expand Down

0 comments on commit e24b4b1

Please sign in to comment.