Closed rmthamer closed 10 years ago
I looked into this - xunit is not populating 'Mocha.process.stdout.write' on the page callback (mocha-phantomjs.coffee, line 73). It does however fire "onConsoleMessage", line 46.
I don't have time right now to write up a fix, but I'll look into it in a few days if nothing gets into a pull request.
I took a look. the xunit
reporter is using console.log instead of process.stdout.write
like every other reporter. This makes it impossible for mocha-phantomjs
to distinquish Reporter output from rogue console.log
calls in the page being tested, which is a big goal of the feature (see #83).
The correct fix is to fix that reporter. It would be a trivial PR.
Grab the next version of mocha that has that fix or use it straight from GitHub
tons of reporters use console.log including the base reporter.
What's the use case to dump a bunch of xml to the console window if you're not using something like mocha-phantomjs to get the results out?
But yes alot of other reporters use console.log
, but the json
reporter doesn't, as it requires unformatted output.
@rmthamer Since that PR got reverted, you have two options:
xunit
reporter and make the changes to use process.stdout.write
console.log
calls.Both of them are good options.
This still issue is still present
https://github.com/mochajs/mocha/pull/2005 has landed, so we should be good to re-enable xunit reporter file writing?
Nothing was ever specifically disabled - it should just work.
Doesn't this conditional prevent the use of the file argument?
https://github.com/nathanboktae/mocha-phantomjs/blob/master/bin/mocha-phantomjs#L122
Ah right, I forgot about that :) I'll remove it shortly.
4.0.2
has that check removed.
mocha-phantomjs -R xunit -f testfile.xml ./testrunner.html
testfile.xml will show up empty. spec works.