testing
Use when writing or reviewing Flutter/Dart tests (unit, widget, golden), fixing flaky tests, adding coverage, or choosing between unit and widget tests.
npx skills add evanca/flutter-ai-rules --skill testing --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Testing Skill Write effective, meaningful Flutter and Dart tests that catch real regressions. ## When to Use Use this skill when: * Writing unit tests for business logic, repositories, or utility classes. * Writing widget tests for UI components. * Reviewing existing tests for correctness and coverage. * Fixing flaky or false-positive tests. * Deciding between unit tests, widget tests, and integration tests. --- ## 1. Test Validity Before writing or accepting a test, ask: > **"Can this test actually fail if the real code is broken?"** - Avoid tests that only confirm mocked/fake behavior without exercising real logic. - Avoid tests that confirm behavior guaranteed by the language or standard library. - Every test must be capable of catching a real regression. ```dart // BAD — tests the mock, not real logic test('should return user', () { when(() => repo.getUser()).thenReturn(fakeUser); expect(repo.getUser(), fakeUser); // Only proves the mock works }); // GOOD — tests the cubit's state transitions driven by the mock blocTest<UserCubit, UserState>( 'should emit loaded state when getUser succeeds', build: () { when(() => repo.getUser()).thenAnswer((_) async => fakeUser); return User
- When to Use
- 1. Test Validity
- 2. Structure
- 3. Naming
- 4. Unit Tests vs Widget Tests
- 5. Widget Test Patterns
- 6. Mocking Best Practices
- 7. Test File Organization
What does the testing skill do?
Use when writing or reviewing Flutter/Dart tests (unit, widget, golden), fixing flaky tests, adding coverage, or choosing between unit and widget tests.
How do I install it?
Run `npx skills add evanca/flutter-ai-rules --skill testing --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From evanca/flutter-ai-rules, a repository with 604 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
