Function forLoop

  • This utility function will do a for loop, synchronously if all the parts are synchronous, and asynchronously otherwise. This should help us to use the same code yet supporting both possible scenarios.

    Returns

    void | Promise

    Type Parameters

    • State

    Parameters

    • initialStateFactory: (() => State | Promise<State>)
        • (): State | Promise<State>
        • Returns State | Promise<State>

    • testBeforeEach: ((a: State) => boolean | Promise<boolean>)
        • (a: State): boolean | Promise<boolean>
        • Parameters

          • a: State

          Returns boolean | Promise<boolean>

    • afterEach: ((a: State) => State | Promise<State>)
        • (a: State): State | Promise<State>
        • Parameters

          • a: State

          Returns State | Promise<State>

    • codeToExecute: ((a: State) => void | Promise<void>)
        • (a: State): void | Promise<void>
        • Parameters

          • a: State

          Returns void | Promise<void>

    Returns any

Generated using TypeDoc