Skip to content

Commit

Permalink
fixed the many test, broke the exit test
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed May 4, 2013
1 parent fa706ae commit 72e34ad
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,16 @@ function createExitHarness (conf) {
stream.on('end', function () { ended = true });

if (conf.exit === false) return harness;
if (!process.exit || !process._getActiveHandles) return harness;
if (!canEmitExit || !canExit) return harness;

var iv = setInterval(function () {
if (process._getActiveHandles().length > 1) return;

clearInterval(iv);
setTimeout(function () {
if (ended) return;
process.on('exit', function (code) {
if (!ended) {
for (var i = 0; i < harness._tests.length; i++) {
var t = harness._tests[i];
t._exit();
}
}, 100);

setTimeout(function () {
process.exit(harness._exitCode);
}, 105);
}
process.exit(code || harness._exitCode);
});
return harness;
}
Expand Down

0 comments on commit 72e34ad

Please sign in to comment.