-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
CustomConsole: print console.error and console.assert to stderr #8261
Conversation
631e8ea
to
6203ed6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some tests failing but code LGTM.
One thing I noticed here is that we're logging to stderr
even when --useStderr
is not set. We should probably fix that at some point.
@scotthovestadt yeah, we need to fix how we use stdio. #8091 aims to fix part of that |
I made a change so this only applies to |
expect(_stdout).toMatch('AssertionError'); | ||
expect(_stdout).toMatch('false == true'); | ||
expect(_stderr).toMatch('AssertionError'); | ||
expect(_stderr).toMatch('The expression evaluated to a falsy value:'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node 11 tries to be smart printing the line that threw the error but it doesn't work well.
7a8ef47
to
5d0f9f2
Compare
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
When using the CLI in
jest-runtime
,console.error
,console.warn
andconsole.assert
print to stdout, which is wrong.CustomConsole
should print to the givenstderr
when calling those methods.Test plan
Added unit tests in
CustomConsole
.