Skip to content

Commit

Permalink
Merge pull request #1170 from smottt/master
Browse files Browse the repository at this point in the history
Improve the output of the dot reporter
  • Loading branch information
johanneswuerbach committed Jan 24, 2018
2 parents 1950ca9 + 3ae1856 commit 6f6c7be
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/reporters/dot_reporter.js
Expand Up @@ -14,6 +14,8 @@ function DotReporter(silent, out) {
this.results = [];
this.startTime = new Date();
this.endTime = null;
this.currentLineChars = 0;
this.maxLineChars = Math.min(this.out.columns || 65, 65) - 5;
this.out.write('\n');
this.out.write(' ');
}
Expand All @@ -36,13 +38,18 @@ DotReporter.prototype = {
if (this.silent) {
return;
}
if (this.currentLineChars > this.maxLineChars) {
this.currentLineChars = 0;
this.out.write('\n ');
}
if (result.passed) {
this.out.write('.');
} else if (result.skipped) {
this.out.write('*');
} else {
this.out.write('F');
}
this.currentLineChars += 1;
},
finish: function() {
if (this.silent) {
Expand Down Expand Up @@ -78,7 +85,7 @@ DotReporter.prototype = {
printf(this.out, '\n%s', indent(error.stack, 5));
}

this.out.write('\n');
this.out.write('\n\n');
}, this);
},
summaryDisplay: function() {
Expand Down
1 change: 1 addition & 0 deletions tests/ci/reporter_tests.js
Expand Up @@ -271,6 +271,7 @@ describe('test reporters', function() {
assert.match(output.shift(), / {7}actual: 'Seven'/);
output.shift();
assert.match(output.shift(), / {5}trace/);
output.shift();
assert.equal(output, '');
});
});
Expand Down

0 comments on commit 6f6c7be

Please sign in to comment.