金色时刻 · 15:48
让好资源,触手可及
AGENT SKILL

testing

testing 是面向测试与安全的 Agent Skill,来自 HoangNguyen0403/agent-skills-standard。查看技能说明、操作步骤与使用约定,并通过原项目了解详细用法。

Unit, widget, and integration testing using mocktail and bloc_test.

SKILL.md

下载 MD ↓
nameFlutter Testing Standards
descriptionUnit, 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 mocktail for 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 blocTest to verify state emission sequences.
  • Code Coverage: Aim for 80%+ coverage on Domain and Presentation (Logic) layers.

Deep Dive References

Related Topics

layer-based-clean-architecture | dependency-injection | cicd

来源:HoangNguyen0403/agent-skills-standard · MIT 许可 · 许可原文 · MD 为来源页保存的历史版本