Skip to content

Commit

Permalink
revert #1068 to make the xunit reporter runnable in browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
travisjeffery committed Dec 23, 2013
1 parent 6ff4bcd commit 3bb53b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 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(){
process.stdout.write(tag('testsuite', {
console.log(tag('testsuite', {
name: 'Mocha Tests'
, tests: stats.tests
, failures: stats.failures
Expand All @@ -60,7 +60,7 @@ function XUnit(runner) {
}, false));

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

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

Expand Down
10 changes: 5 additions & 5 deletions mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -3984,7 +3984,7 @@ function XUnit(runner) {
});

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

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

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

Expand Down

0 comments on commit 3bb53b3

Please sign in to comment.