-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
only write to stdout in reporters #1061
Conversation
what's fiddly about using 2> like any other stderr redirect? |
It means that if the process crashes, I get no output to the console. Stderr contains both actual error output, and test failures on some reporters. For example, if I enable "debug" output through the debug module, this gets mixed in with the output. The mechanics of capturing stderr aren't fiddly, but getting only the reporter output is. |
Are you still against this change? The main driver is the case where I'd like to enable debug logging without breaking my formatter output redirection. |
+1 |
35c1580
to
64dfc0b
Compare
only write to stdout in reporters
oops just merged this and it's breaking our test suite. |
Saw the problem. Base reporter's tests are expecting the output/stack to be put in And guess what this PR's change is? Writing only on |
Mark todo for mochajs/mocha#1061 done
The base reporter outputs some of its failure information to stderr via console.error - this makes it a bit fiddly to redirect output from any reporter using Base.list
This patch switches them over to stdout via console.log, it also means that debug output on stderr won't get mixed in with test results.