Home > @wixc3/testing > withTimeout
Limits the time a promise can take
Signature:
export declare function withTimeout<T>(action: Promise<T>): PromiseWithTimeout<T>;
Parameter | Type | Description |
---|---|---|
action | Promise<T> | a promise that should be settled before the timeout |
Returns:
await withTimeout(sleep(1000)).description('will time out').timeout(10)
timeout: 5000