☕️ Classic, reliable, trusted test framework for Node.js and the browser
revert #1068 to make the xunit reporter runnable in browsers
Travis Jeffery3bb53b39db3c
diff --git a/lib/reporters/xunit.js b/lib/reporters/xunit.jsindex e2175433..e956380d 100644--- a/lib/reporters/xunit.js+++ b/lib/reporters/xunit.js@@ -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@@ -60,7 +60,7 @@ function XUnit(runner) {}, false));tests.forEach(test);- process.stdout.write('</testsuite>');+ console.log('</testsuite>');});}@@ -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) );}}diff --git a/mocha.js b/mocha.jsindex 9b54d25e..0e568b46 100644--- a/mocha.js+++ b/mocha.js@@ -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@@ -3995,7 +3995,7 @@ function XUnit(runner) {}, false));tests.forEach(test);- process.stdout.write('</testsuite>');+ console.log('</testsuite>');});}@@ -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) );}}