-
Notifications
You must be signed in to change notification settings - Fork 31
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
Not working for modern fake timers (jest v27) #30
Comments
I had the same issue. Essentially, wait for expect would always time out no matter what, as if its timeouts were not being advanced. However, I can fix the issue by doing the following:
for some reason, it fails if I do nothing, but succeeds if I tell jest to use either timer variant. Not sure what's up with that. |
It seems like dd272db is probably relevant to what causes this issue? FWIW the beforeAll trick doesn't seem to work for me. |
It's impossible to use wait-for-expect and legacy fake timers with Jest v27. So is needed to set legacy timers when using wait for expect and change to fake timers when need to `advanceTimersByTime`. TheBrainFamily/wait-for-expect#34 TheBrainFamily/wait-for-expect#30
It's impossible to use wait-for-expect and legacy fake timers with Jest v27. So is needed to set legacy timers when using wait for expect and change to fake timers when need to `advanceTimersByTime`. TheBrainFamily/wait-for-expect#34 TheBrainFamily/wait-for-expect#30
The existing check for jest fake timers no longer works as jest v27 mutates the `setTimeout` global differently. This patch checks for both the old and new formats.
wait-for-expect
does not work in combination withmodern
fake timers which are default in jest v27. Probably related issue: callstack/react-native-testing-library#775The text was updated successfully, but these errors were encountered: