StaticcreateCreates an entity with minimal boilerplate for testing.
The entity class to instantiate
Entity ID (string or EntityId)
Entity properties
Optionaltimestamps: { createdAt?: Date; updatedAt?: Date }Optional timestamps (defaults to now)
The created entity
StaticcreateStaticcreateStaticcreateCreates an event bus that captures all published events.
Useful for asserting that specific events were published during a test.
Object with the event bus and array of captured events
StaticwaitWaits for a specific event type to be published on an event bus.
Useful for async event testing where you need to wait for an event before making assertions.
The event bus to monitor
The event class to wait for
Maximum time to wait in milliseconds (default: 5000)
Promise that resolves with the event or null if timeout
StaticcreateCreates a spy/mock event bus that tracks all published events.
Different from createEventBusCapture in that it doesn't actually publish events to handlers, just captures them for inspection.
Object with the mock bus and captured events
Test helpers for common testing patterns in Stratix applications.
Provides utilities to simplify test setup, entity creation, and event testing.
Example