Skip to content

armgit / mocha

Public Imported from GitHub
0

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

Fix dot reporter output bugs

Shaine Hatch2b592a606f7c
diff --git a/lib/reporters/dot.js b/lib/reporters/dot.js
index 0c298ba7..e2004683 100644
--- a/lib/reporters/dot.js
+++ b/lib/reporters/dot.js
@@ -25,13 +25,14 @@ function Dot(runner) {
var self = this
, stats = this.stats
, width = Base.window.width * .75 | 0
- , n = 0;
+ , n = -1;
runner.on('start', function(){
process.stdout.write('\n ');
});
runner.on('pending', function(test){
+ if (++n % width == 0) process.stdout.write('\n ');
process.stdout.write(color('pending', Base.symbols.dot));
});
@@ -59,4 +60,4 @@ function Dot(runner) {
* Inherit from `Base.prototype`.
*/
-Dot.prototype.__proto__ = Base.prototype;
\ No newline at end of file
+Dot.prototype.__proto__ = Base.prototype;