Hierarchy

  • BaseTestUtils

Constructors

Methods

  • Parameters

    • version: 0 | 1 = 1
    • codec: number = 0x71
    • hasher: number = 0x12

    Returns CID<unknown, number, number, Version>

  • Wait up to 'timeoutMs' for the given predicate to return true. Polls the given predicate once every 100ms (plus however long it takes for the predicate itself to execute). Throws an Error if the predicate does not become true within the timeout. The error message in the thrown Error can be customized with the 'errMsgGenerator' arg.

    Parameters

    • predicate: (() => Promise<boolean>)

      function that returns a boolean. predicate function will be called multiple times, until either it returns true or the timeout passes.

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

    • timeoutMs: number = ...

      time limit for how long the predicate has to return true.

    • Optional errMsgGenerator: string | (() => string)

      customization for the message text in the thrown Error on timeout. Can be a single string, or a function that is called to generate a string, which can be useful when used with a closure over state in the test so that the error message can include additional information about current state.

    Returns Promise<void>