Skip to content

Commit 7e14ade

Browse files
authored
Clarify waitFor documentation in regards to timer mocks (#538)
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 2752518 commit 7e14ade

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
@@ -354,7 +354,7 @@ test('waiting for an Banana to be ready', async () => {
354354
In order to properly use `waitFor` you need at least React >=16.9.0 (featuring async `act`) or React Native >=0.60 (which comes with React >=16.9.0).
355355
:::
356356

357-
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.
357+
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.
358358

359359
## `waitForElementToBeRemoved`
360360

0 commit comments

Comments
 (0)