Create-react-app: [v4] What else has been changed in testing ?

Created on 23 Oct 2020  路  4Comments  路  Source: facebook/create-react-app

I upgraded react-scripts in my project from version 3.4.x to 4.0.0 and testing isn't like before.

I read the changelog, you said that you've upgraded to Jest 26 and now set resetMocks to true by default in the Jest config! (hmm, this isn't expected), so, I added:

"resetMocks": false,

to make my tests work again. I fixed some other new Eslint warning (and that's okay)...
BUT, Now it covers only a part of the test suits!
I have 420 tests (551 suites) in the project,

"test": "react-scripts test --coverage --watchAll=true",

runs only 118 (25 suites)!

Thanks!

needs triage

Most helpful comment

Can you please try setting watchAll to false and let me know if that changes anything?

All 4 comments

Can you please try setting watchAll to false and let me know if that changes anything?

It works fine with watchAll set to false! thanks!
BUT, is that a bug or what!? we need the watchAll after all 馃槶

I am getting: "Nothing was returned from render"

@chrkaatz maybe is related to this issue in jest?

Was this page helpful?
0 / 5 - 0 ratings