From 2b592a606f7c5431cf8d843af75f47b4e216f9f9 Mon Sep 17 00:00:00 2001 From: Shaine Hatch Date: Mon, 5 May 2014 23:27:48 -0600 Subject: [PATCH] Fix dot reporter output bugs Fixed: - Pending test dots not being counted (leading to longer rows of dots when containing pending tests) - Off-by-one error on first dot row (first row always lacks a dot) --- lib/reporters/dot.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/reporters/dot.js b/lib/reporters/dot.js index 0c298ba71d..e200468343 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;