flutter-testinglisted
Install: claude install-skill thiennc-tesoglobal/flutter-skills
# Flutter Testing
Test observable behavior at the cheapest layer that provides confidence.
## Choose the layer
- Unit tests: pure logic, state transitions, repositories, parsing, and failure policy.
- Widget tests: rendering, semantics, interaction, focus, navigation wiring, and state-to-UI behavior.
- Golden tests: stable visual contracts where platform/font control makes comparison meaningful.
- Integration tests: critical flows, plugin integration, performance, and behavior requiring a real target.
Do not replace behavior assertions with implementation details such as private method calls or exact widget-tree shape.
## Reliability
- Inject clocks, randomness, storage, and transports when determinism matters.
- Prefer small fakes over large mock graphs; verify outputs and side effects rather than incidental calls.
- Control async progress with the test framework; avoid arbitrary sleeps.
- Pump until a known state or bounded completion, not an unbounded `pumpAndSettle` when animations or timers persist.
- Give tests independent data and clean up global bindings, files, databases, and subscriptions.
- Update a golden only after reviewing the rendered difference.
## Disposable test probes
Classify each new test before creating it. Keep regression, acceptance, and specification tests as normal project files. A passing test is not a reason to delete it.
For a one-off diagnostic probe that should not be committed:
- Prefer an isolated temporary project or directory outs