Shim Mocha.process.stdout.write() inst of console.log()
Turns out Mocha deliberately exposes it:
https://github.com/mochajs/mocha/pull/916
diff --git a/test/unit.html b/test/unit.html
index 80e7e00..de37741 100644
--- a/test/unit.html
+++ b/test/unit.html
@@ -29,18 +29,8 @@
reporter: 'xunit'
});
- var console_log = console.log;
- var xunit = "";
- console.log = function() {
- var str = arguments[0];
-
- if (str === 'stdout:') {
- xunit += arguments[1];
- }
-
- return console_log.apply(console, arguments);
- };
-
+ var xunit = '';
+ Mocha.process.stdout.write = function(line) { xunit += line; };
</script>
<!-- include the library with the tests inlined -->