Skip to content

Commit

Permalink
put back whitespace to annoy @Raynos
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Dec 21, 2012
1 parent 6a3b299 commit ce84d89
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,50 +17,50 @@ function createHarness (conf_) {
var pending = [];
var running = false;
var count = 0;

var began = false;
var out = new Render();

var test = function (name, conf, cb) {
count++;
var t = new Test(name, conf, cb);
if (!conf || typeof conf !== 'object') conf = conf_ || {};

if (conf.exit !== false && canEmitExit) {
process.on('exit', function (code) {
t._exit();
out.close();
if (!code && !t._ok) process.exit(1);
});
}

process.nextTick(function () {
if (!out.piped) out.pipe(createDefaultStream());
if (!began) out.begin();
began = true;

var run = function () {
running = true;
out.push(t);
t.run();
};

if (running || pending.length) {
pending.push(run);
}
else run();
});

t.on('test', function sub (st) {
count++;
st.on('test', sub);
st.on('end', onend);
});

t.on('end', onend);

return t;

function onend () {
count--;
if (this._progeny.length) {
Expand All @@ -73,7 +73,7 @@ function createHarness (conf_) {
});
pending.unshift.apply(pending, unshifts);
}

process.nextTick(function () {
running = false;
if (pending.length) return pending.shift()();
Expand All @@ -86,7 +86,7 @@ function createHarness (conf_) {
});
}
};

test.stream = out;
return test;
}
Expand Down

1 comment on commit ce84d89

@Raynos
Copy link
Collaborator

@Raynos Raynos commented on ce84d89 Dec 21, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol.

Please sign in to comment.