Namespace: timingUtil
@atomic-testing/core.timingUtil
Functions
wait
▸ wait(ms
): Promise
<void
>
Wait a number of milliseconds
Parameters
Name | Type | Description |
---|---|---|
ms | number | A number of milliseconds to wait |
Returns
Promise
<void
>
Defined in
packages/core/src/utils/timingUtil.ts:6
waitUntil
▸ waitUntil<T
>(probeFn
, terminateCondition
, timeoutMs
): Promise
<T
>
Keep running a probe function until it returns a value that matches the terminate condition or timeout
Type parameters
Name |
---|
T |
Parameters
Name | Type | Description |
---|---|---|
probeFn | () => T | Promise <T > | A function that returns a value or promised value to be checked against the terminate condition |
terminateCondition | T | (currentValue : T ) => boolean | A value to check for equality or a function used for custom equality check |
timeoutMs | number | A number of milliseconds to wait before returning the last value |
Returns
Promise
<T
>
The last value returned by the probe function