Closed
Description
Describe the Feature
Current signature for waitForElement
is:
function waitForElement<T>(
expectation: () => T,
timeout: number = 4500,
interval: number = 50
): Promise<T> {
Testing Library, has a similar signature
function waitFor<T>(
callback: () => void,
options?: {
timeout?: number
interval?: number
}
): Promise<T>
where timeout and interval are moved into optional options
object. Benefits of options
object vs positional arguments are:
- better usage readability: named options
{ timeout: 1000 }
vs positional argument (..., 1000)
) options
arguments is open for extension of adding more options.
Also we should rename waitForElement
as waitFor
for Testing Library compatibility. In TL waitForElement
is deprecated with info to use waitFor
& findBy
instead.
Possible Implementations
Change signature for waitForElement
to use options
optional argument.
Related Issues
Metadata
Metadata
Assignees
Labels
No labels