API Reference / @gtkx/testing / waitFor
Variable: waitFor
constwaitFor: <T>(callback,options?) =>Promise<T>
Defined in: wait-for.d.ts:11
Repeatedly invokes a callback until it succeeds without throwing or the timeout elapses, retrying on each rejection at a fixed interval.
Type Parameters
T
T
Parameters
callback
() => T | Promise<T>
The assertion or query to retry; its resolved value is returned.
options?
Optional timeout, interval, and timeout error customization.
Returns
Promise<T>
The callback's result once it succeeds.