Packages
usecase_forge_test
Deterministic lifecycle testing with observers, matchers, event-driven waiting, and controlled time.
v0.1.0-dev.1Intermediateusecase_forge_test
Open source reference ↗usecase_forge_test
The test package observes public lifecycle behavior. It does not expose private queues or provide a magic settle() operation that guesses when asynchronous work is complete.
Install
shell
dart pub add --dev usecase_forge_test
Primary tools
UseCaseTestscopes setup, action, waiting, assertion, and cleanup.UseCaseTestObserverrecords observable lifecycle events.- Matchers express phases, results, state, and command identity.
TestUseCaseClockcontrols debounce, throttle, rate limit, and time-dependent behavior.
Tests should wait for a domain or lifecycle boundary: a terminal result, a matching snapshot, a rejection, or a known event count. Fixed delays are neither deterministic nor explanatory.