Function emits

  • Asserts that the emitter emits the specified event before the test ends. Returns a promise that resolves when the event is emitted. Note that waiting on the returned promise within a test can deadlock the test, if the event never emits, but the returned promise can be a handy way to pause a test until an event happens, if you are reasonably confident that it will fire.

    Parameters

    • emitter: EventEmitter<DefaultEventMap> | EventTarget
    • event: string
    • Rest...__namedParameters: MessageExtra

    Returns Promise<void>