Skip to content

Commit

Permalink
Merge pull request #46 from thorn0/patch-1
Browse files Browse the repository at this point in the history
Fix the error with redirecting stdout to a file on Windows
  • Loading branch information
bterlson committed Sep 20, 2015
2 parents 79290eb + 3fd012b commit 65aa9f3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/simpleReporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ function actualString(test) {
}

module.exports = through(function(data) {
process.stdout.clearLine();
process.stdout.cursorTo(0);
if (process.stdout.clearLine && process.stdout.cursorTo) {
process.stdout.clearLine();
process.stdout.cursorTo(0);
}

if(data.pass) {
state.pass++;
Expand All @@ -49,8 +51,10 @@ module.exports = through(function(data) {
" Got: " + actualString(data) + "\n\n");
}
}, function() {
process.stdout.clearLine();
process.stdout.cursorTo(0);
if (process.stdout.clearLine && process.stdout.cursorTo) {
process.stdout.clearLine();
process.stdout.cursorTo(0);
}
console.log("Ran " + (state.pass + state.fail) + " tests")
console.log(state.pass + " passed")
console.log(state.fail + " failed")
Expand Down

0 comments on commit 65aa9f3

Please sign in to comment.