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

only write to stdout in reporters #1061

Merged
merged 1 commit into from
Dec 15, 2014

Conversation

glenjamin
Copy link
Contributor

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.

@travisjeffery
Copy link
Contributor

what's fiddly about using 2> like any other stderr redirect?

@glenjamin
Copy link
Contributor Author

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.

@glenjamin
Copy link
Contributor Author

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.

@boneskull boneskull added the status: waiting for author waiting on response from OP - more information needed label Sep 16, 2014
@TooTallNate
Copy link
Contributor

+1

travisjeffery pushed a commit that referenced this pull request Dec 15, 2014
only write to stdout in reporters
@travisjeffery travisjeffery merged commit 13d93cf into mochajs:master Dec 15, 2014
@travisjeffery
Copy link
Contributor

oops just merged this and it's breaking our test suite.

@dasilvacontin
Copy link
Contributor

Saw the problem. Base reporter's tests are expecting the output/stack to be put in stderr.

And guess what this PR's change is? Writing only on stdout. Voilà.

graingert added a commit to graingert/mocha-multi that referenced this pull request Oct 5, 2017
glenjamin added a commit to glenjamin/mocha-multi that referenced this pull request Oct 5, 2017
@boneskull boneskull removed the status: waiting for author waiting on response from OP - more information needed label Dec 12, 2017
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

Successfully merging this pull request may close these issues.

6 participants