`waitFor` with nested `expect` timeout in v9
See original GitHub issueDescribe the bug
Hey guys, I’ve been banging my head for hours following a migration to v9.
I had some timeout issues with a waitFor
and I thought it was related to the timers thingy, but in fact in seems related to a nested it looks like it could be related to timers.expect
in my waitFor
This works:
await screen.findByA11yRole('progressbar', { interval: 10 }); // Need more aggressive interval to catch the spinner before it is removed
waitForElementToBeRemoved(() => screen.getByA11yRole('progressbar'));
This doesn’t and acts weird:
await screen.findByA11yRole('progressbar', { interval: 10 }); // Need more aggressive interval to catch the spinner before it is removed
await waitFor(() => {
expect(screen.queryByA11yRole('progressbar')).toBeFalsy();
});
When debugging the waitFor
it appears to ignore interval
or even timeout
settings and is executed only twice, once right away and once when the default timeout hits.
Expected behavior
To work
Steps to Reproduce
Feels like this should be easily reproducible. I’ll look into it if not.
Screenshots
Versions
@testing-library/react-native: ^9.0.0 => 9.0.0
react: 17.0.2 => 17.0.2
react-native: 0.65.1 => 0.65.1
react-test-renderer: ^17.0.2 => 17.0.2 ```
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Jest react testing: Check state after delay - Stack Overflow
For example this code will wait for 2 seconds: await new Promise((r) => setTimeout(r ... 30000 will make sure to not timeout for...
Read more >Configuring timeouts in Spring reactive WebClient
This article is about configuring the read and connect timeout values when using Spring WebClient. It explains the difference between reactive signal ...
Read more >How to time out Jenkins Pipeline stage and keep the pipeline ...
Now it works just as we expect. The A stage gets executed, and it is acceptable to timeout. The pipeline continues in such...
Read more >Troubleshoot CloudFormation stacks that are stuck in progress
In most situations, you must wait for your CloudFormation stack to time out. The timeout length varies, and is based on the individual ......
Read more >How to Fix a Lock Wait Timeout Exceeded Error in MySQL
The above simply means the transaction has reached the innodb_lock_wait_timeout ; After T2 was successfully committed, one would expect to get ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry didn’t have time to really follow up on that. I will test again with the latest version and report at least
Closing as stale.
@florian-milky If the issue still occurs on the latest version of RNTL, please provide a minimal repro repository, hopefully based on
examples/basic
folder from our repo, so that we can better understand the issue.