Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

refactor previous merge

TJ Holowaychuk971497317df7
diff --git a/lib/reporters/base.js b/lib/reporters/base.js
index fc3038c9..2fe294a9 100644
--- a/lib/reporters/base.js
+++ b/lib/reporters/base.js
@@ -257,7 +257,7 @@ Base.prototype.epilogue = function(){
console.log();
- var pluralizeTest = function(n) {
+ function pluralize(n) {
return 1 == n ? 'test' : 'tests';
}
@@ -268,9 +268,10 @@ Base.prototype.epilogue = function(){
+ color('light', ':')
console.error(fmt,
- stats.failures,
- this.runner.total,
- pluralizeTest(this.runner.total));
+ stats.failures,
+ this.runner.total,
+ pluralize(this.runner.total));
+
Base.list(this.failures);
console.error();
return;
@@ -282,18 +283,16 @@ Base.prototype.epilogue = function(){
+ color('light', ' (%dms)');
console.log(fmt,
- stats.tests || 0,
- pluralizeTest(stats.tests),
- stats.duration);
+ stats.tests || 0,
+ pluralize(stats.tests),
+ stats.duration);
// pending
if (stats.pending) {
fmt = color('pending', ' •')
+ color('pending', ' %d %s pending');
- console.log(fmt,
- stats.pending,
- pluralizeTest(stats.pending));
+ console.log(fmt, stats.pending, pluralize(stats.pending));
}
console.log();