Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xunit reporter should use process.stdout.write instead of console.log #1068

Merged
merged 1 commit into from
Dec 12, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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