Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mocha.process.stdout not working properly? #197

Closed
jchoi18 opened this issue Aug 18, 2015 · 1 comment
Closed

Mocha.process.stdout not working properly? #197

jchoi18 opened this issue Aug 18, 2015 · 1 comment

Comments

@jchoi18
Copy link

jchoi18 commented Aug 18, 2015

Except when using JSON as reporter, I believe the mocha.process.stdout isn't working properly. For example in the mocha-phantomjs.coffee, even if I comment out the following code:
@page.onConsoleMessage = (msg) -> system.stdout.writeLine(msg)

I should still see the test results from the following right?
@page.onCallback = (data) =>
if data?.hasOwnProperty 'Mocha.process.stdout.write'
@output.write data['Mocha.process.stdout.write']

But instead, all test results / client side console messages seem to be getting captured by the browser console. If I comment out the first line, nothing gets output on my terminal. (except when using json, json outputs fine)

I'm trying to do this since the application I'm testing has a lot of noise on the client side (events firing, etc.) and I want to be able to block them out in my tests. Also I believe this is causing all the test output to have no color formatting (green / red colors).

Just wondering, where is the code exactly telling mocha to output to Mocha.process.stdout? I tried looking in individual reporter files but they all have the regular process.stdout.

@nathanboktae
Copy link
Owner

See #114, #189, #161 . TL;DR is like you found that moat mocha reporters use console.log so its impractical to separate the noise out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants