Skip to content

Commit 7ba3152

Browse files
authored
Clarify waitFor documentation in regards to timer mocks (#540)
Update documentation to explicitly state that one should not await the return or resolution of a `waitFor` call when relying upon timer mocks.
1 parent 7e14ade commit 7ba3152

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

website/docs/API.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ You can use any of `getBy`, `getAllBy`, `queryBy` and `queryAllBy` queries for `
392392
In order to properly use `waitForElementToBeRemoved` you need at least React >=16.9.0 (featuring async `act`) or React Native >=0.60 (which comes with React >=16.9.0).
393393
:::
394394

395-
If you're using Jest's [Timer Mocks](https://jestjs.io/docs/en/timer-mocks#docsNav), remember not to use `async/await` syntax as it will stall your tests.
395+
If you're using Jest's [Timer Mocks](https://jestjs.io/docs/en/timer-mocks#docsNav), remember not to await the return of `waitFor` as it will stall your tests.
396396

397397
## `within`, `getQueriesForElement`
398398

0 commit comments

Comments
 (0)