Skip to main content

Namespace: timingUtil

@atomic-testing/core.timingUtil

Functions

wait

wait(ms): Promise<void>

Wait a number of milliseconds

Parameters

NameTypeDescription
msnumberA 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

NameTypeDescription
probeFn() => T | Promise<T>A function that returns a value or promised value to be checked against the terminate condition
terminateConditionT | (currentValue: T) => booleanA value to check for equality or a function used for custom equality check
timeoutMsnumberA number of milliseconds to wait before returning the last value

Returns

Promise<T>

The last value returned by the probe function

Defined in

packages/core/src/utils/timingUtil.ts:21