Skip to content

armgit / mocha

Public Imported from GitHub
0

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

change dot reporter to use sexy unicode dots

TJ Holowaychuk3371c134c6e8
diff --git a/lib/reporters/dot.js b/lib/reporters/dot.js
index 20158dba..c6403150 100644
--- a/lib/reporters/dot.js
+++ b/lib/reporters/dot.js
@@ -25,6 +25,7 @@ function Dot(runner) {
var self = this
, stats = this.stats
, width = Base.window.width * .75 | 0
+ , c = '․'
, n = 0;
runner.on('start', function(){
@@ -32,21 +33,21 @@ function Dot(runner) {
});
runner.on('pending', function(test){
- process.stdout.write(color('pending', '.'));
+ process.stdout.write(color('pending', c));
});
runner.on('pass', function(test){
if (++n % width == 0) process.stdout.write('\n ');
if ('slow' == test.speed) {
- process.stdout.write(color('bright yellow', '.'));
+ process.stdout.write(color('bright yellow', c));
} else {
- process.stdout.write(color(test.speed, '.'));
+ process.stdout.write(color(test.speed, c));
}
});
runner.on('fail', function(test, err){
if (++n % width == 0) process.stdout.write('\n ');
- process.stdout.write(color('fail', '.'));
+ process.stdout.write(color('fail', c));
});
runner.on('end', function(){