Skip to content

Commit

Permalink
Clarify waitFor documentation in regards to timer mocks (#540)
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 7e14ade commit 7ba3152
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 @@ -392,7 +392,7 @@ You can use any of `getBy`, `getAllBy`, `queryBy` and `queryAllBy` queries for `
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).
:::

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.

## `within`, `getQueriesForElement`

Expand Down

0 comments on commit 7ba3152

Please sign in to comment.