diff --git a/docs/dom-testing-library/api-async.md b/docs/dom-testing-library/api-async.md index 53a282fef..5272e04ad 100644 --- a/docs/dom-testing-library/api-async.md +++ b/docs/dom-testing-library/api-async.md @@ -105,8 +105,6 @@ The options object is forwarded to `waitFor`. ## `wait` (DEPRECATED, use waitFor instead) -## `wait` - ```typescript function wait( callback: () => void, @@ -120,6 +118,8 @@ function wait( ``` Previously, wait was a wrapper around wait-for-expect and used polling instead of a MutationObserver to look for changes. It is now an alias to waitFor and will be removed in a future release. +Unlike wait, the callback parameter is mandatory in waitFor. Although you can migrate an existing `wait()` call to `waitFor( () => {} )`, it is considered bad practice to use an empty callback because it will make the tests more fragile. + ## `waitForDomChange` (DEPRECATED, use waitFor instead) ```typescript