kentcdodds / react-testing-library-course

Test React Components with Jest and React Testing Library on TestingJavaScript.com
https://testingjavascript.com/playlists/test-react-components-with-jest-and-react-testing-library-72cf
Other
1.09k stars 379 forks source link

Testing configuration runs slow on Windows 10 #21

Open SimeonRolev opened 4 years ago

SimeonRolev commented 4 years ago

Hi,

I purchased the course and didn't change any of the setup, but the test run really slow (3-6s). I use Windows 10 and saw that someone else filed this issue: https://github.com/facebook/jest/issues/7631. I commented there as well describing my issue in more details, but I don't see much of an activity towards resolving it. Is there a fix that you know of?

Thanks!

kentcdodds commented 4 years ago

I'm afraid I have no more to offer than what is suggested in that issue. Did you try installing watchman?

nasreddineskandrani commented 4 years ago

@SimeonRolev can you try to run jest directly from inside the repo.

"test": "kcd-scripts test",

yarn test is calling kcd-scripts maybe something inside is creating this behavior?

i ll look at it again when i find time

kentcdodds commented 4 years ago

kcd-scripts has a few nice things built-in, but it's unlikely to cause this problem. However, it's possible. You should be able to run npx jest and it'll run all the tests, you can run npx jest --watch to run in watch mode.

SimeonRolev commented 4 years ago

image

npx jest --watch -> p -> this file. Hit enter multiple times, because the first run is always slow.

I got a dual boot with Ubuntu, so there it is as well: Screenshot from 2020-10-21 13-29-27

kentcdodds commented 4 years ago

Odd. Unfortunately I don't have the bandwidth to look into this.

nasreddineskandrani commented 4 years ago

I'll look at it during next week. I am interested to learn how to debug well jest anyway...

nasreddineskandrani commented 3 years ago

a little busy :P i'll take the time to check it during my vacations in first week of january.