-
Notifications
You must be signed in to change notification settings - Fork 709
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
10.4.4 causing timeout issue with useEffect+jest.useFakeTimers #523
Comments
This should be resolved with testing-library/react-testing-library#739 which will be published in a moment. If it's not fixed in the next version, please comment here. |
I updated my repro project to use 10.4.5, and I'm still seeing the same error. |
Rats. If anyone would like to dig a little bit to find what the issue is that would be welcome :-) |
As I can see from the code, the problem could be that So when If this is the case a possible solution, that i really don't like but it is my first thought, is to override |
Yeah it looks like that's the issue. I'll look into it today.
@awesomeunleashed thanks for the reproduction, this is really helpful. |
I think we may be able to make the cleanup work whether fake timers are enabled or not. I'll be thinking about this |
It looks like what's happening here is that React used fakeTimers inside the scheduler package since it was used within the component,
|
This should be resolved with testing-library/react-testing-library#744 which was published a few hours ago. |
Transferred |
Our tests pass with 10.4.6. Thanks, guys! |
@testing-library/react
version: 10.4.4Relevant code or config:
What you did:
I have a component that has a
useEffect
in it and its tests usejest.useFakeTimers
. My tests for the component passed until I updated to@testing-library/react
10.4.4.What happened:
The test now fails with this message:
Reproduction:
See https://github.com/awesomeunleashed/rtl-10-4-4-repro
Problem description:
I believe these tests should still be passing.
Suggested solution:
I imagine this has something to do with the scheduler changes in testing-library/react-testing-library#732, as
useEffect
andjest.useFakeTimers
sound like scheduling-related things, but I don't see anything obviously related without knowing the code.The text was updated successfully, but these errors were encountered: