Skip to content

Commit

Permalink
Merge pull request #1068 from nathanboktae/xunit-stdout
Browse files Browse the repository at this point in the history
xunit reporter should use process.stdout.write instead of console.log
  • Loading branch information
Travis Jeffery committed Dec 12, 2013
2 parents 5cd2add + d3cc218 commit c0bcf71
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/reporters/xunit.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function XUnit(runner) {
});

runner.on('end', function(){
console.log(tag('testsuite', {
process.stdout.write(tag('testsuite', {
name: 'Mocha Tests'
, tests: stats.tests
, failures: stats.failures
Expand All @@ -60,7 +60,7 @@ function XUnit(runner) {
}, false));

tests.forEach(test);
console.log('</testsuite>');
process.stdout.write('</testsuite>');
});
}

Expand All @@ -84,11 +84,11 @@ function test(test) {
if ('failed' == test.state) {
var err = test.err;
attrs.message = escape(err.message);
console.log(tag('testcase', attrs, false, tag('failure', attrs, false, cdata(err.stack))));
process.stdout.write(tag('testcase', attrs, false, tag('failure', attrs, false, cdata(err.stack))));
} else if (test.pending) {
console.log(tag('testcase', attrs, false, tag('skipped', {}, true)));
process.stdout.write(tag('testcase', attrs, false, tag('skipped', {}, true)));
} else {
console.log(tag('testcase', attrs, true) );
process.stdout.write(tag('testcase', attrs, true) );
}
}

Expand Down

0 comments on commit c0bcf71

Please sign in to comment.