-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Warning: The current testing environment is not configured to support act(...) #1336
Comments
I'm not sure why you didn't get the above before, but this should be resolved by using yarn |
Sadly that didn't help, at least with v10. testing-library/react v15 works for now. Maybe the issue isn't the dom library, but something else with v16? All I have to do to fix this is downgrade to v15.0,7. yarn why @testing-library/dom
├─ @storybook/test@npm:8.1.10
│ └─ @testing-library/dom@npm:10.1.0 (via npm:^10.1.0)
│
└─ tatsu@workspace:.
└─ @testing-library/dom@npm:10.1.0 (via npm:^10.1.0) |
Chiming in with this issue also and some info. Works fine. Current solution is to use this while we investigate
All of these combinations have the issue
Also using
Most other dependencies are up-to-date, except for eslint+ ffmpeg (unrelated)
Link to repo if you want an example (branch: dependencies)
|
@viveleroi Can you please provide a reproduction for this one so we'll be able to investigate? @ryanlelek The issue you're experiencing isn't related to the version of testing library AFAIU. A few things I saw in your tests:
Btw, I highly recommend not waiting 1 second in your tests and use fake timers instead. |
One solution has been removing the flagged |
After updating from v15 to v16 of testing-library/react, I'm now getting this error in all of my tests - except the tests still pass just fine.
Warning: The current testing environment is not configured to support act(...)
The error goes away when I downgrade to v15. Since @testing-library/dom is now a peer dep, I tried installing that as well but the error remains.
@testing-library/react
version: 16With v15, here's what yarn why says (no warnings about act):
In 16 with dom added, here's what why says (warnings on act):
The text was updated successfully, but these errors were encountered: