← Back to list

flutter-testing-standards
by HoangNguyen0403
A collection of Agent Skills Standard and Best Practice for Programming Languages, Frameworks that help our AI Agent follow best practies on frameworks and programming laguages
⭐ 111🍴 40📅 Jan 23, 2026
SKILL.md
name: Flutter Testing Standards description: Unit, widget, and integration testing using mocktail and bloc_test. metadata: labels: [testing, junit, mocktail, bloc_test, golden-tests] triggers: files: ['/test/.dart'] keywords: [test, group, expect, mocktail, blocTest, when, any]
Testing Standards
Priority: P1 (HIGH)
Ensuring code reliability through multi-layered testing strategies.
Structure
test/
├── unit/ # Business logic & mapping (Blocs, Repositories, UseCases)
├── widget/ # UI component behavior (Screens, Widgets)
└── integration/ # End-to-end flows
Implementation Guidelines
- Testing Pyramid: Maintain ~70% Unit Tests, ~20% Widget Tests, ~10% Integration Tests.
- Mocks: Use
mocktailfor type-safe, boilerplate-free mocking. - Unit Tests: Test logic in isolation. Verify all edge cases (Success, Failure, Exception).
- Widget Tests: Test high-value interactions (Button clicks, Error states, Loading indicators).
- BLoC Tests: Use
blocTestto verify state emission sequences. - Code Coverage: Aim for 80%+ coverage on Domain and Presentation (Logic) layers.
Deep Dive References
- Unit Testing Strategies (Test Data Builders, Mocktail)
- Widget Testing Strategies (Robot Pattern)
- Integration Testing (Shared Robots, Real Device)
- Robot Pattern Implementation
🚫 Anti-Patterns
- Thread Sleep:
**No Future.delayed**: Use FakeAsync or expectations for deterministic timing. - Missing Assertions:
**No "Execution Only" Tests**: A test without an expect() call is invalid. - Over-Mocking:
**No Mocking Data Classes**: Use real instances for Entities/Models; mock only I/O. - Test Pollution:
**No Shared State**: Ensure every test is Independent (FIRST).
Related Topics
layer-based-clean-architecture | dependency-injection | cicd
Score
Total Score
85/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
✓説明文
100文字以上の説明がある
+10
✓人気
GitHub Stars 100以上
+5
✓最近の活動
1ヶ月以内に更新
+10
✓フォーク
10回以上フォークされている
+5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
✓タグ
1つ以上のタグが設定されている
+5
Reviews
💬
Reviews coming soon

