Skip to content

Commit

Permalink
Clarify waitFor documentation in regards to timer mocks (#538)
Browse files Browse the repository at this point in the history
Update documentation to explicitly state that one should not await the
return or resolution of a `waitFor` call when relying upon timer mocks.
  • Loading branch information
dcalhoun authored Sep 9, 2020
1 parent 2752518 commit 7e14ade
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion website/docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ test('waiting for an Banana to be ready', async () => {
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).
:::

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.
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.

## `waitForElementToBeRemoved`

Expand Down

0 comments on commit 7e14ade

Please sign in to comment.