Skip to content

Commit

Permalink
Merge pull request #6485 from Turbo87/fix-test-runner
Browse files Browse the repository at this point in the history
tests/runner: Fix "capture-exit" compatibility
  • Loading branch information
rwjblue committed Nov 30, 2016
2 parents dc27a69 + 8cfc89e commit fd2c2af
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/runner.js
Expand Up @@ -5,6 +5,7 @@ var Mocha = require('mocha');
var RSVP = require('rsvp');
var fs = require('fs-extra');
var mochaOnlyDetector = require('mocha-only-detector');
var exit = require('capture-exit');

if (process.env.EOLNEWLINE) {
require('os').EOL = '\n';
Expand Down Expand Up @@ -57,10 +58,9 @@ function checkOnlyInTests() {
function runMocha() {
console.time('Mocha Tests Running Time');
mocha.run(function(failures) {
process.on('exit', function() {
console.timeEnd('Mocha Tests Running Time');
process.exit(failures);
});
console.timeEnd('Mocha Tests Running Time');
exit.releaseExit();
process.exit(failures);
});
}

Expand All @@ -79,5 +79,6 @@ ciVerificationStep()
.catch(function(error) {
console.error(error);
console.error(error.stack);
exit.releaseExit();
process.exit(1);
});

0 comments on commit fd2c2af

Please sign in to comment.