Skip to content
Back to skills

Dart Testing

ASecurity

Unit, widget, golden and integration tests for Flutter and Dart. Use when adding tests, reproducing a bug with a failing test, or verifying a screen's states.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 2, 2026
ai-agentsgotesting

Security analysis

A100/100

Scanned December 2, 2026

npx -y skills add kinleyrabgay/coxswain --skill dart-testing --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Dart Testing?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Dart Testing
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/kinleyrabgay-dart-testing/badge)](https://www.skillsdirectory.com/skills/kinleyrabgay-dart-testing)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: dart-testing
description: Unit, widget, golden and integration tests for Flutter and Dart. Use when adding tests, reproducing a bug with a failing test, or verifying a screen's states.
---
# Testing Flutter apps

## Kinds of tests
- **Unit** (`test/`): pure Dart logic, state holders, repositories with mocks.
- **Widget** (`test/`, `testWidgets`): a screen or widget in each state; pump with the app's theme, localisation and providers/blocs overridden.
- **Golden**: pixel snapshots of key widgets, if the project already uses them (`matchesGoldenFile`, alchemist or golden_toolkit). Update goldens only on purpose and say so.
- **Integration** (`integration_test/`): the main user flow on a device/emulator.

## Writing good tests
- Find widgets by key, text or semantics label the way a user would see them; avoid relying on widget tree internals.
- `await tester.pumpAndSettle()` after interactions; for endless animations pump a duration instead.
- Mock network and platform channels; tests never hit real servers or real accounts.
- Cover: loading, empty, error with retry, success; long text and large text scale; small and large screen sizes.
- Bug fixes start with a failing test that reproduces the bug.

## Running
- `flutter test path/to/file_test.dart` for what you touched, then `flutter test`.
- `flutter analyze` must be clean. Integration tests: `flutter test integration_test` only when a device is available.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.