flutter-bloc-testing

Community

Prove your Bloc emits the right states.

AuthorabdallhMoukdad
Version1.0.0
Installs0

System Documentation

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.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: flutter-bloc-testing
Download link: https://github.com/abdallhMoukdad/flutter-bloc-skills/archive/main.zip#flutter-bloc-testing

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.