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
Identify which test is causing the act(...)
warning
#658
Comments
I actually just noticed that this is a ReactDOM issue, not an RTL one:
I'm looking into the RTL repo now, but is there a way to determine if this error gets called? |
Could you include what you're doing and what you're currently seeing? It's unclear whether this is a testing-library or react or jest issue. |
In the latest version of jest, logs will include stack traces which should help determine the source of the act warning a lot more. Try updating jest? |
Hi @eps1lon So the The other scenario in which this is happening, and one more frustrating, is when I use the Full issue can be found here: TanStack/query#432 I think you might be right in that this is probably not a RTL issue, in which case I'll be happy to have this problem closed. @kentcdodds I did just upgrade, and while the verbose logging helped for some unrelated errors, it didn't help in determining exactly which tests were running the |
Interesting... It's helped me a ton: https://twitter.com/kentcdodds/status/1260611107539963905 Sorry it's been so much trouble for you @andrico1234. As you mentioned, it's not an React Testing Library issue, so I'll go ahead and close this. Good luck. |
bash to the rescue. (note: I did this on a mac) came up with a grep that solves this:
results:
I did not include fail because you can find your tests that are failing with the following bash command.
|
made a cool gist about this https://gist.github.com/MichaelDimmitt/5b82abc956974fc5b3f9ea2bc8b3159c |
Describe the feature you'd like:
When working on a test file (or many test files)that contains many
it
blocks, that breaks the rules of theact
function, it's difficult to determine which test is causing this based on the error message alone:Suggested implementation:
I suggest logging out the first argument of the
it
function.e.g.
should display the following in the console:
Describe alternatives you've considered:
Teachability, Documentation, Adoption, Migration Strategy:
The text was updated successfully, but these errors were encountered: