CustomConsole: print console.error and console.assert to stderr#8261
CustomConsole: print console.error and console.assert to stderr#8261rubennorte merged 7 commits intojestjs:masterfrom
Conversation
631e8ea to
6203ed6
Compare
scotthovestadt
left a comment
There was a problem hiding this comment.
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.
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.warnandconsole.assertprint to stdout, which is wrong.CustomConsoleshould print to the givenstderrwhen calling those methods.Test plan
Added unit tests in
CustomConsole.