hako_test library
Testing library for Hako state management.
Provides utilities for testing BaseHako state containers, asserting on
event stream emissions, running declarative tests, and matching Hako events.
Functions
-
expectHakoEmits<
T extends BaseHako> (T hako, FutureOr< void> execution(T hako), Iterable matchers, {String? reason, dynamic skip}) → Future<void> -
Asserts that executing
executionon ahakoinstance emits a sequence ofHakoEvents matchingmatchersin order, followed by stream completion. -
hakoTest<
H extends BaseHako> (String description, {required H build(), FutureOr< void> setUp(H hako)?, FutureOr<void> act(H hako)?, dynamic expect()?, FutureOr<void> verify(H hako)?, FutureOr<void> tearDown(H hako)?, dynamic skip, dynamic tags, int? retry, Duration? timeout}) → void -
Creates a new
BaseHako-specific test case with the givendescription. -
isGetEvent<
T> ({String? name, dynamic state}) → Matcher -
Returns a matcher that asserts a
GetEventof typeTwas emitted. -
isSetEvent<
T> ({String? name, dynamic previous, dynamic current}) → Matcher -
Returns a matcher that asserts a
SetEventof typeTwas emitted.