🐛 Bug: Inconsistent Reporter Use of Console and Stdout #2943
Labels
semver-patch
implementation requires increase of "patch" version number; "bug fixes"
status: accepting prs
Mocha can use your help with this one!
type: chore
generally involving deps, tooling, configuration, etc.
The title of this issue is the crux. It appears that the default
spec
reporter usesconsole.log
rather than the built-inprocess.stdout
that other reporters use. And there doesn't seem to be a pattern to which reporters use which output method.Some reporters like spec (https://github.com/mochajs/mocha/blob/master/lib/reporters/spec.js#L40) are using console.log, some like dot(
mocha/lib/reporters/dot.js
Line 31 in 503627c
My use case involves utilizing headless chrome to run mocha tests. I'm providing a proxy to
window.mocha.process.stdout
to use a message bus that I've injected, that pipes raw messages back to the node app which catches them via the Chrome DevTools Protocol. It might sound complex, but it's rather simple. Without knowing which actor (user code or mocha) is callingconsole.log
, I can't effectively show console messages in the terminal with any distinction between actors.The "simple" fix would be to standardize all reports on one output method - preferably
mocha.process.stdout
.The text was updated successfully, but these errors were encountered: