SKILL

flutter-testing

Flutter testing strategy (Flutter team, Very Good Ventures, LeanCode/Patrol; verified 2026) - fakes vs mocks, unit tests with mocktail, widget tests, golden tests with Alchemist, E2E/UI tests with Patrol including native permission dialogs and notifications, device farms and sharding, Widget Previews, Widgetbook, debugging tools. Use this whenever the user writes, fixes, or plans Flutter tests, sees flaky goldens or CI test failures, needs to test permissions/notifications/native UI, picks between integration_test, Appium and Patrol, or asks how to make Flutter code testable.

原文 · 译文尚未补齐

适用对象:移动应用开发。自动收录 · 待核查。

原作者说明节选

从固定版本的 SKILL.md 提取,保留原文语言。以下内容属于作者说明,本站尚未验证安装、兼容或运行结果。

查看英文原文

原文涵盖的主题

  • Flutter testing
  • Rules that apply to every level
  • Unit tests
  • Widget tests
  • Golden tests
  • UI / E2E tests with Patrol
  • Component catalogs & previews
  • Debugging

Verified 2026-09-25: Flutter 3.47, patrol 4.10, alchemist 0.14, mocktail 1.0, bloctest 10, flutterriverpod 3.4. For Riverpod/Bloc-specific test APIs, see flutter-state-management/references/. Use the testing pyramid on purpose. Most coverage in fast unit tests of logic, widget tests for components, a few goldens for visuals, and E2E UI tests only for critical user journeys. Each level checks something the others can't. Don't duplicate edge cases upward. | Level | Checks | Tool | |---|---|---| | Unit | Business logic, Cubits/Notifiers/ViewModels, repositories, mappers, validators | fluttertest + mocktail | | Widget | A component/screen's behavior in isolation | fluttertest (patrolfinders for nicer finders) | | Golden | How it looks: design-system components | Alchemist | | UI / E2E | The app's main purpose works end-to-end, including native UI | Patrol | Fakes over mocks (Flutter team, "strongly recommend"). Write FakeUserRepository implements UserRepository with in-memory behavior in testing/fakes/. Mocks (mocktail) are for checking interactions or one-off stubs. Keep them private per test file (class MockApi extends Mock implements Api {}), so a stub in one file can't leak into an

这里只展示节选,请以完整原文和当前要求为准。

来源仓库
abugeek/flutter-skills
源文件
.claude/skills/flutter-testing/SKILL.md
固定版本
458377635834ad1cff2c4871ac0725a5ef4bcd4f
阅读完整原作者说明 ↗

准备条件

  • 本条仅收录原作者的技能元数据;请阅读完整说明,确认依赖、许可与使用条件。

第一件可以尝试的小事

先阅读原作者说明,再决定是否在自己的 AI 工具中使用。

对应 AI 工具说明

作者有说明不等于本站实机验证。没有证据时,不自动标为兼容、安全或免费。

来源与内容状态

本条为自动发现的元数据,尚未完成人工文档核查;适用性与运行结果待核查。

原作者:abugeek/flutter-skills · 原作者仓库元数据。文档核查:未核查。最近来源检查:2026-11-10T09:01:53.930Z。

分类由名称、说明与路径规则生成,分类不代表已核实适配。

许可与权利归属

MIT。第三方内容及版权归原作者,使用条件以原文为准。

许可原文 ↗

本站没有因同步、复制或用户自报成功而将资源标为运行验证通过。

限制与注意事项

  • 元数据收录不代表本站已经安装、适配、实测或进行安全审查。