Skip to content

Commit

Permalink
whitespace back
Browse files Browse the repository at this point in the history
  • Loading branch information
Raynos committed Jan 19, 2013
1 parent bd1db4e commit 2666849
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 @@ -24,16 +24,16 @@ function createHarness (conf_) {
var pending = [];
var running = false;
var count = 0;

var began = false;
var closed = 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) {
onexit(function (code) {
t._exit();
Expand All @@ -44,34 +44,34 @@ function createHarness (conf_) {
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 @@ -84,7 +84,7 @@ function createHarness (conf_) {
});
pending.unshift.apply(pending, unshifts);
}

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

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

0 comments on commit 2666849

Please sign in to comment.