-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
React-scripts test is swallowing console logs, warnings, and errors #1368
Comments
I know this might end up being an issue with |
This might be an issue with Jest on Node 7: jestjs/jest#2457 Can you clone CRA and verify whether upgrading Jest packages to |
In particular you'd need to clone the repo and run Then you could put some logs in Then you could bump Jest package versions in Then run |
Alright, I cloned CRA and added tests with logging. Passing and failing tests show all expected console output. I attempted to generate an app with my clone of CRA with So this must mean it's an environment thing for me, right? What is different between testing the templates within my clone of CRA vs. testing a generated app with my clone of CRA (both of which have the proper output)? And how was my globally installed npm package of CRA any different to cause the initial issue? |
We updated Jest in master to 18.0 in #1311 but it’s not in any CRA release yet. So maybe that fixed it for you? Can you try reverting that commit locally? |
Maybe we can cut 0.9 with just the Jest update and a few fixes, and postpone bigger plans for 0.10. @fson What do you think? |
i know 0.8.5 was only released 5 days ago, so I'm assuming the 0.9 release might be a while. that's totally fine. is there anything I might be able to do in the meantime as a workaround? |
@gaearon I think 0.8.6 will be better for Jest updating and bug fixes |
We can't cut 0.8.6 for this because Jest 17 => 18 contained breaking changes. |
thanks for the fix! |
Thank you for reporting! |
Hi @gaearon |
This issue has been closed for a while, but it popped again for me today. For those who may also be looking for a solution over a year later, some searching suggested that adding the Specifically, in package.json I updated the line for the test script to be |
I fell over this yesterday as well but it turned out that without 'watch' it worked. run the following on windows for test now "set CI=true && react-scripts test" |
Can you reproduce the problem with latest npm?
Yes, I'm already on
npm@4.0.5
.Description
Create a new app:
Add the following tests to
src/App.test.js
:Run the tests with either
yarn
ornpm
.Expected behavior
I would expect any of these
console
statements to print to stdout somewhere in the test output.Actual behavior
The test output shows two passing tests and one failing test, as expected, along with the usual general test info and commands. But the logged output is nowhere to be found.
Environment
npm ls react-scripts
(if you haven’t ejected): 0.8.5node -v
: v7.4.0npm -v
: 4.0.5Operating system: OSX 10.11.6
Browser and version: n/a
Reproducible Demo
See description
The text was updated successfully, but these errors were encountered: