Packages
ark_data_layer_test
Verify Repository notifications and lifecycle without owning the Repository or its sources.
A development-only companion for testing Repository notifications. Your
application continues to use ark_data_layer; this package does not change its
runtime API or impose application data policies.
dependencies:
ark_data_layer: ^1.2.2
dev_dependencies:
ark_data_layer_test: ^1.0.0
test: ^1.31.2
What the observer does
RepositoryTestObserver<Data>(repository)subscribes immediately.dataEventsrecords delivered values, including the initial replay.waitForDataCount(count)waits for at least that many events.waitForDone()waits for actual stream completion.cancel()cancels only this subscription, not the Repository or its sources.
Start with the complete Repository test: it includes a concrete class, operation, assertions and cleanup. The guide explains why matching the first events does not exclude extras, how to assert refresh errors separately and how to handle a failed close.
Deadlines and ownership
Waits default to five seconds and each has its own timer. A met condition completes immediately. Timeout does not cancel a load, subscription or cleanup Future. Observation failures are typed; actual stream errors retain their original StackTrace. Diagnostic text does not print business data.
Lists are unmodifiable, but business objects are not deep-cloned. An exact
final-sequence assertion requires done; cancelling the subscription is not
stream completion. External resources and other subscriptions remain owned by
their original owners.