heartbeat_mock

Allows to create mock implementations of Heartbeat, compatible to the "axHeartbeat" injection.

Contents

Module Members

Types

Module Members

create()

Creates a mock for the "axHeartbeat" injection of a widget.

Returns
Type Description
HeartbeatMock a fresh mock instance

Types

HeartbeatMock

extends Heartbeat

A mock version of Heartbeat, with additional methods.

Offers spied-upon version of the usual axHeartbeat methods, as well as a flush method for synchronous scheduling of heartbeat events, and a reset methods to clear all listeners.

HeartbeatMock.reset()

Reset the internal state of the mock, clearing all onBeforeNext, onNext and onAfterNext callbacks.

HeartbeatMock.flush()

If any onNext callbacks have been schedules, synchronously runs all scheduled onBeforeNext, onNext and onAfterNext callbacks, clearing the corresponding queues in the process.