diff --git a/lib/vows.js b/lib/vows.js index 187b4e4..bc43dd6 100644 --- a/lib/vows.js +++ b/lib/vows.js @@ -129,7 +129,7 @@ function addVow(vow) { // If not, report an error message. // process.addListener('exit', function () { - var results = { honored: 0, broken: 0, errored: 0, pending: 0, total: 0 }; + var results = { honored: 0, broken: 0, errored: 0, pending: 0, total: 0 }, failure; vows.suites.forEach(function (s) { if ((s.results.total > 0) && (s.results.time === null)) { @@ -138,6 +138,7 @@ process.addListener('exit', function () { } s.batches.forEach(function (b) { if (b.status !== 'end') { + failure = true; results.errored ++; results.total ++; vows.reporter.report(['error', { error: "A callback hasn't fired", batch: b, suite: s }]); @@ -145,7 +146,7 @@ process.addListener('exit', function () { Object.keys(results).forEach(function (k) { results[k] += b[k] }); }); }); - if (results.total) { + if (failure) { sys.puts(console.result(results)); } });