augment-vir - v31.13.0
    Preparing search index...

    Variable waitUntilConst

    waitUntil: <T>(
        callback: () => T,
        options?: WaitUntilOptions,
        failureMessage?: string,
    ) => Promise<T> & typeof waitUntilMethods = ...

    A group of guard methods that run the given callback multiple times until its return value matches expectations. Callback interval and timeout can be customized with WaitUntilOptions.

    This can also be called as a standalone wait until function which waits until the callback's returned value is truthy.

    import {waitUntil} from '@augment-vir/assert';

    // `result` will eventually be `'123'`
    const result = await waitUntil.isString(
    () => {
    if (Math.random() < 0.5) {
    return 123;
    } else {
    return '123';
    }
    },
    {
    interval: {milliseconds: 100},
    timeout: {seconds: 10},
    },
    );

    The successful callback return value.

    AssertionError When the assertion fails.