Function waitFor

  • Function which will halt the Process until the Testcallback deliveres "true"

    Export

    Returns

    Parameters

    • testCallback: (() => boolean | Promise<boolean>)

      Function which is used to periodically test the State

        • (): boolean | Promise<boolean>
        • Returns boolean | Promise<boolean>

    • Optional options: {
          additionalDelay?: number;
          delay?: number;
          initialWait?: number;
          maxRetries?: number;
          maxTimeout?: number;
          testFirst?: boolean;
      } = {}

      Options to enhance the behavior. Look at the details

      • Optional additionalDelay?: number

        A Delay which is added after the Test is fullfilled, before the Promise is done.

      • Optional delay?: number

        Delay to wait, after an unsucessfull test.

      • Optional initialWait?: number

        Inital delay, before the test is started.

      • Optional maxRetries?: number

        Max amount of retries before an execption is raised

      • Optional maxTimeout?: number

        Timeout afterwhich the Test will fail.

      • Optional testFirst?: boolean

        Flag to enable testing the call the callback directly before proceeding or just ensure the inital waiting time

    Returns Promise<void>

Generated using TypeDoc