After upgrade to CRA 2.0, tests run very slow.
See original GitHub issueIs this a bug report?
I think so.
After upgrade to CRA 2.0 Jest tests run much slower than before. I think it could be made by Jest 23
Did you try recovering your dependencies?
yes, but problem still exists
Which terms did you search for in User Guide?
Running Tests
Environment
Environment: OS: Windows 10 Node: 8.11.2 Yarn: 1.10.1 npm: 6.4.1 Watchman: Not Found Xcode: N/A Android Studio: Not Found
Packages: (wanted => installed) react: ^16.5.2 => 16.5.2 react-dom: ^16.5.2 => 16.5.2 react-scripts: 2.0.3 => 2.0.3
Steps to Reproduce
Tests in previous version reloaded less than 1s. After upgrade to CRA 2.0 tests reload in about 3-4sec. Problec occurs even if I create new empty project
- create-react-app app
- npm run test
Expected Behavior
It should be faster 😦
Actual Behavior
Reproducible Demo
(Paste the link to an example project and exact instructions to reproduce the issue.)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:27 (13 by maintainers)
Top Results From Across the Web
With CRA upgrade from 3.4.1 to 4.0.3 tests are running much ...
the tests are 3x slower when run with runInBand , they take approx. 1700 seconds compared to approx. 600 seconds before the update;;...
Read more >How to make your sluggish Jest tests go faster - ITNEXT
A step-by-step guide how to improve performance of your slow Jest unit test and make them blazingly fast and delightful again.
Read more >Running Tests | Create React App
Every time you save a file, it will re-run the tests, like how npm start recompiles the code. *Although we recommend running your...
Read more >CRA typescript is compiling slow - DEV Community
CRA with typescript is bit slow even after "skipLibCheck": true . Mostly I find hitting F5 better than waiting for the page to...
Read more >Optimizing Performance - React
However, they make React larger and slower so you should make sure to use the production version ... If your project is built...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fresh create-react-app (2.1.1).
So while the test actually seems to run pretty fast (41ms), the setup takes 6 seconds. Re-running doesn’t make it faster.
Windows 10 x64, I7 4690K, SSD…
We also struggle with slow tests if we run:
react-scripts-ts test --env=jsdom
but if we run them with coverage flag they are way faster
react-scripts-ts test --env=jsdom --coverage
I understand that it should be the opposite 😃
We are running:
"react": "^16.2.0", "react-dom": "^16.2.0", "react-redux": "^5.0.6", "react-router-dom": "^4.2.2", "react-scripts-ts": "2.17.0", "enzyme-adapter-react-16": "^1.1.1",