Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
Merge pull request #102 from bitwiseman/patch-1
Browse files Browse the repository at this point in the history
Hijack process.stdout as well as console.log
  • Loading branch information
kmiyashiro committed Jan 10, 2014
2 parents b338f43 + b4361bf commit 719ebf6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tasks/mocha.js
Expand Up @@ -165,11 +165,15 @@ module.exports = function(grunt) {
var dest = this.data.dest;
var output = [];
var consoleLog = console.log;
// Latest mocha xunit reporter sends to process.stdout instead of console
var processWrite = process.stdout.write;


// Only hijack if we really need to
if (dest) {
console.log = function() {
consoleLog.apply(console, arguments);
processWrite.apply(process.stdout, arguments);
output.push(util.format.apply(util, arguments));
};
}
Expand Down

0 comments on commit 719ebf6

Please sign in to comment.