diff --git a/lib/vows.js b/lib/vows.js index f8200d6..5fb583a 100644 --- a/lib/vows.js +++ b/lib/vows.js @@ -129,7 +129,9 @@ function addVow(vow) { // If not, report an error message. // process.addListener('exit', function () { - if (vows.suites.filter(function (s) { return s.results.time === null }).length > 0) { + if (vows.suites.filter(function (s) { + return (s.results.total > 0) && (s.results.time === null) + }).length > 0) { vows.reporter.report(['error', { error: "An EventEmitter has failed to fire.", type: 'promise' }]); } }); diff --git a/lib/vows/suite.js b/lib/vows/suite.js index 57299fc..faa15b8 100644 --- a/lib/vows/suite.js +++ b/lib/vows/suite.js @@ -171,8 +171,10 @@ this.Suite.prototype = new(function () { } } }); + if (! ctx.tests._skip) { + batch.remaining --; + } // Check if we're done running the tests - batch.remaining --; exports.tryEnd(batch); // This is our initial, empty context })(new(Context)({ callback: tests, context: null, description: null }, {})); @@ -197,15 +199,23 @@ this.Suite.prototype = new(function () { start = new(Date); - this.report(['subject', this.subject]); + if (this.batches.filter(function (b) { return b.remaining > 0 }).length) { + this.report(['subject', this.subject]); + } (function run(batches) { - var batch; + var batch = batches.shift(); - if (batch = batches.shift()) { - that.runVows(batch).addListener('end', function () { + if (batch) { + // If the batch has no vows to run, + // go to the next one. + if (batch.remaining === 0) { run(batches); - }); + } else { + that.runVows(batch).addListener('end', function () { + run(batches); + }); + } } else { that.results.time = (new(Date) - start) / 1000;