Skip to content

Commit

Permalink
getting further into the child ordering test
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed May 2, 2013
1 parent c9def14 commit 8a80302
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/results.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ Results.prototype.push = function (t, parentT) {
t.on('test', function (st) {
subtests ++;
st.on('end', function () {
self.running --;
subtests --;
if (subtests === 0 && !plan) t.emit('end');
nextTick(function () { onend.call(t) });
});
self.push(st, t);
if (subtests === 1) nextTick(function () { st.run() });
Expand All @@ -80,10 +77,10 @@ Results.prototype.push = function (t, parentT) {
if (subtests !== 0) return;
self.running --;

if (!self.running && self.tests.length === 0) {
if (self.running === 0 && self.tests.length === 0) {
self.close();
}
else if (!self.running) {
else if (self.running === 0) {
var t = self.tests.shift();
t.run();
}
Expand Down

0 comments on commit 8a80302

Please sign in to comment.