Skip to content

armgit / mocha

Public Imported from GitHub
0

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

Changing the code according to the comments in the pull-request

Attila Domokos141ba203b0a9
diff --git a/lib/reporters/base.js b/lib/reporters/base.js
index d06217c0..fc3038c9 100644
--- a/lib/reporters/base.js
+++ b/lib/reporters/base.js
@@ -193,7 +193,7 @@ exports.list = function(failures){
function Base(runner) {
var self = this
- , stats = this.stats = { suites: 0, tests: 0, passes: 0, pendings: 0, failures: 0 }
+ , stats = this.stats = { suites: 0, tests: 0, passes: 0, pending: 0, failures: 0 }
, failures = this.failures = [];
if (!runner) return;
@@ -239,8 +239,7 @@ function Base(runner) {
});
runner.on('pending', function(){
- stats.pendings = stats.pendings || 0;
- stats.pendings++;
+ stats.pending++;
});
}
@@ -258,13 +257,8 @@ Base.prototype.epilogue = function(){
console.log();
- var pluralizeTest = function(numberOfTests) {
- if (numberOfTests === 1) {
- return "test";
- }
- else {
- return "tests";
- }
+ var pluralizeTest = function(n) {
+ return 1 == n ? 'test' : 'tests';
}
// failure
@@ -293,13 +287,13 @@ Base.prototype.epilogue = function(){
stats.duration);
// pending
- if (stats.pendings > 0) {
- fmt = color('pending', ' *')
+ if (stats.pending) {
+ fmt = color('pending', ' •')
+ color('pending', ' %d %s pending');
console.log(fmt,
- stats.pendings,
- pluralizeTest(stats.pendings));
+ stats.pending,
+ pluralizeTest(stats.pending));
}
console.log();