Basically a fancy Deferred, wrapped around an existing promise, used by the @tapjs/core!test-base.TestBase#waitOn method, and tracked in the @tapjs/core!test-base.TestBase#queue.

The callback function is called when it's been either resolved or rejected. The Waiter internal promise is resolved if the wrapped promise matches our expectation. The value member is the resolved value or rejection error.

Constructors

Properties

cb: null | ((w) => any)

Callback to call when the promise resolves, or null if not provided

Type declaration

    • (w): any
    • Parameters

      Returns any

done: boolean = false

Set when the Waiter's promise has either resolved or rejected

expectReject: boolean
finishing: boolean = false
promise: Promise<void>
ready: boolean = false

whether or not this waiter is ready to process

rejected: boolean = false

True if the promise rejected

resolve: null | ((value?) => void) = null

Type declaration

    • (value?): void
    • Parameters

      • Optional value: any

      Returns void

resolved: boolean = false

True if the promise resolved successfully

value: any = undefined

The resolved value, or the error that was raised on rejection

Methods

  • Tell the waiter to abandon the promise and stop waiting. Called when tests time out or bail out.

    Parameters

    • er: Error

    Returns void

Generated using TypeDoc