What problem does it solve?
Writing Bloc tests that confidently verify the exact emitted state sequence is difficult, especially when concurrency transformers, async handlers, and HydratedBloc persistence are involved.
Core Features & Use Cases
- Deterministic Bloc testing with bloc_test: Build a fresh Bloc, drive events, and assert an ordered list of emitted states using a single declarative test harness.
- mocktail-based repository mocking: Mock Repository dependencies without code generation, including registering fallback values for complex argument types.
- Concurrency transformer verification: Use controlled timing with Completer to prove behavioral contracts for restartable/droppable/sequential-style handlers (e.g., cancellation of in-flight work).
- HydratedBloc persistence round-trip tests: Replace HydratedBloc.storage with an in-memory Storage fake, clear per test, and assert rehydration after restart.
Quick Start
Use the flutter-bloc-testing skill to write bloc_test + mocktail unit tests for a Bloc event handler and include at least one case that proves the behavior of a concurrency transformer.