Skip to content

Commit bd1db4e

Browse files
committed
fix close bug
1 parent ad90739 commit bd1db4e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

index.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ function createHarness (conf_) {
2626
var count = 0;
2727

2828
var began = false;
29+
var closed = false;
2930
var out = new Render();
3031

3132
var test = function (name, conf, cb) {
@@ -36,6 +37,10 @@ function createHarness (conf_) {
3637
if (conf.exit !== false) {
3738
onexit(function (code) {
3839
t._exit();
40+
if (!closed) {
41+
closed = true
42+
out.close();
43+
}
3944
if (!code && !t._ok) process.exit(1);
4045
});
4146
}
@@ -83,7 +88,8 @@ function createHarness (conf_) {
8388
process.nextTick(function () {
8489
running = false;
8590
if (pending.length) return pending.shift()();
86-
if (count === 0) {
91+
if (count === 0 && !closed) {
92+
closed = true
8793
out.close();
8894
}
8995
if (conf.exit !== false && canExit && !t._ok) {

0 commit comments

Comments
 (0)