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: Waiter) => any)

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

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?: any) => void) = null
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