Skip to content

Commit

Permalink
change to output # of pending / passing even on failures. Closes #872
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed May 31, 2013
1 parent 510a901 commit 5d1df37
Showing 1 changed file with 19 additions and 29 deletions.
48 changes: 19 additions & 29 deletions lib/reporters/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,48 +279,38 @@ function Base(runner) {
*/

Base.prototype.epilogue = function(){
var stats = this.stats
, fmt
, tests;
var stats = this.stats;
var tests;
var fmt;

console.log();

function pluralize(n) {
return 1 == n ? 'test' : 'tests';
}

// failure
if (stats.failures) {
fmt = color('bright fail', ' ' + exports.symbols.err)
+ color('fail', ' %d of %d %s failed')
+ color('light', ':')

console.error(fmt,
stats.failures,
this.runner.total,
pluralize(this.runner.total));

Base.list(this.failures);
console.error();
return;
}

// pass
// passes
fmt = color('bright pass', ' ')
+ color('green', ' %d %s complete')
+ color('green', ' %d passing')
+ color('light', ' (%s)');

console.log(fmt,
stats.tests || 0,
pluralize(stats.tests),
stats.passes || 0,
ms(stats.duration));

// pending
if (stats.pending) {
fmt = color('pending', ' ')
+ color('pending', ' %d %s pending');
+ color('pending', ' %d pending');

console.log(fmt, stats.pending);
}

// failures
if (stats.failures) {
fmt = color('fail', ' %d failing');

console.log(fmt, stats.pending, pluralize(stats.pending));
console.error(fmt,
stats.failures);

Base.list(this.failures);
console.error();
}

console.log();
Expand Down

0 comments on commit 5d1df37

Please sign in to comment.