You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're having an odd issue since upgrading to v13. We had a lot of tests suddenly break, and they were all tests that depended on waitFor, whether using it directly or using a findBy query. For some reason when the waitFor loop advances jest timers, the screen is no longer updating, so expectations and queries never resolve.
What I found fixed the issue for now is to set concurrentRoot: false, but that can only be temporary until react v19.
Interestingly, I also tried editing the wait-for.js code directly to wrap jest.advanceTimersByTime(interval); in act and that also worked. However it appears IS_REACT_ACT_ENVIRONMENT is purposely set to false, so I have to assume the omission of act is intentional, so I don't understand why concurrentRoot: true would suddenly break the tests.
The test with concurrentRoot: false passes with no issue, but in the concurrentRoot: true test, findBy never finds the button: Unable to find an element with role: button.
I'm experiencing the same issue after the recent upgrade to react-native 0.77.1 and @testing-library/react-native: 13.0.1. I am also on react 18.3.1 and jest 29.7.0.
We're having an odd issue since upgrading to v13. We had a lot of tests suddenly break, and they were all tests that depended on
waitFor
, whether using it directly or using afindBy
query. For some reason when thewaitFor
loop advances jest timers, the screen is no longer updating, so expectations and queries never resolve.What I found fixed the issue for now is to set
concurrentRoot: false
, but that can only be temporary until react v19.Interestingly, I also tried editing the
wait-for.js
code directly to wrapjest.advanceTimersByTime(interval);
inact
and that also worked. However it appearsIS_REACT_ACT_ENVIRONMENT
is purposely set to false, so I have to assume the omission ofact
is intentional, so I don't understand whyconcurrentRoot: true
would suddenly break the tests.I wrote a small test to illustrate:
The test with
concurrentRoot: false
passes with no issue, but in theconcurrentRoot: true
test,findBy
never finds the button:Unable to find an element with role: button
.Any ideas?
react: 18.3.1
react-native: 0.77.0
react-test-renderer: 18.3.1
@testing-library/react-native: 13.0.1
jest: 29.7.0
Thanks
The text was updated successfully, but these errors were encountered: