Skip to content

Commit

Permalink
additional test
Browse files Browse the repository at this point in the history
  • Loading branch information
juergba committed Jan 11, 2020
1 parent 35a50c6 commit a4cfa86
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/integration/fixtures/uncaught/listeners.fixture.js
@@ -0,0 +1,12 @@
'use strict';

const assert = require('assert');
const mocha = require("../../../../lib/mocha");

for (let i = 0; i < 15; i++) {
const r = new mocha.Runner(new mocha.Suite("" + i, undefined));
r.run();
}

assert.equal(process.listenerCount('uncaughtException'), 1);
assert.equal(process.listeners('uncaughtException')[0].name, 'uncaughtEnd');
12 changes: 12 additions & 0 deletions test/integration/uncaught.spec.js
Expand Up @@ -86,4 +86,16 @@ describe('uncaught exceptions', function() {
done();
});
});

it('removes uncaught exceptions handlers correctly', function(done) {
run('uncaught/listeners.fixture.js', args, function(err, res) {
if (err) {
return done(err);
}

expect(res, 'to have passed').and('to have passed test count', 0);

done();
});
});
});

0 comments on commit a4cfa86

Please sign in to comment.