agentsclimarketplace

Testing

Skill launch52-ai/flutter-template/.claude/skills/testing

Write, review, and audit tests for Flutter projects using Clean Architecture + Riverpod. Use when writing unit tests, widget tests, golden tests, reviewing test quality, checking test coverage, creating mocks/spies, or testing Riverpod providers.From its SKILL.md

Install
npx -y skills add launch52-ai/flutter-template --skill testing

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

3.1 KB, 706 tokens by cl100k_base, as published. Nobody here has run it

Testing - Write & Review Tests

Write high-quality, maintainable tests following Clean Architecture patterns. Every test should clearly express intent and catch regressions without being brittle.

When to Use This Skill

  • Writing new tests (unit, widget, golden, integration)
  • Reviewing test code quality
  • Setting up test infrastructure (helpers, mocks, spies)
  • Testing Riverpod providers and notifiers
  • Auditing test coverage

Quick Reference

Test Types

TypePurposeWhen to Use
UnitIsolated logicRepositories, services, utils, providers
WidgetUI interactionsScreens, navigation
GoldenVisual regressionLayout, themes
IntegrationReal implementationsStorage, cache, API flows

Naming Conventions

TypePatternExample
File{component}_test.dartauth_repository_impl_test.dart
Testtest_{subject}_{scenario}_{expected}test_signIn_withValidCredentials_returnsAuthResult
Factoryany{Type}()anyEmail(), anyUserProfile()
SUTmakeSUT()Creates System Under Test

Commands

# Run all tests
flutter test

# Run with coverage
flutter test --coverage

# Run specific type
flutter test test/unit/
flutter test test/widget/

# Audit test coverage
dart run .claude/skills/testing/scripts/check.dart

# Generate missing test files
dart run .claude/skills/testing/scripts/check.dart --generate

# Update golden files
flutter test --update-goldens test/golden/

Workflow

1. Create Test File

Mirror source path: test/unit/features/{feature}/data/repositories/{name}_test.dart

2. Write Tests Using Patterns

See patterns-guide.md for:

  • makeSUT() - Factory for System Under Test
  • Spy Pattern - Track method calls
  • Arrange-Act-Assert - Clear structure
  • Disposal Testing - Verify cleanup
  • Inbox Checklist - Infrastructure testing

3. Verify Coverage

dart run .claude/skills/testing/scripts/check.dart

Checklist

Structure:

  • Uses makeSUT() for consistent setup
  • Uses any*() factories for test data
  • Clear Arrange-Act-Assert structure

Coverage:

  • Tests success and error paths
  • Verifies side effects (storage, API calls)

Quality:

  • No hardcoded delays
  • No flaky assertions
  • Disposal tested

Coverage Expectations

ComponentMinimum
Repositories90%+
Providers85%+
Utils80%+
Widgets60%+

Guides

GuideUse For
patterns-guide.mdTest patterns, helpers, spies
examples.mdBefore/after examples

Related Skills

  • /a11y - Accessibility tests (textContrastGuideline, etc.)

What ships with it: 14 files

179.4 KB alongside SKILL.md

scripts/

Keep looking

Skills are one crate of 326,835. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.