# testing

> Claude/Codex skill by [@verygoodopensource](https://omgskills.com/library/verygoodopensource/index.md) · 173 stars · Updated 2026-10-20

Best practices for Dart unit tests, Flutter widget tests, and golden file tests, covering group and test naming, setUp lifecycle and isolation, mocking with package:mocktail, and the shared pumpApp helper. Use when writing, modifying, or reviewing tests, goldens included, that use package:test, package:flutter\_test, package:mocktail, or package:bloc\_test, and when no package is named: adding a golden test, matchesGoldenFile, tagging or updating goldens, writing a unit or widget test, or adding a test helper or mock. A one-line golden or widget test request is in scope, including under "Dart code only"; a widget in a UI package is ui-package's. Use it too when the request asks for what these standards forbid: package:mockito, a raw string test tag instead of TestTag, an inline pumpWidget(MaterialApp(...)), asserting padding, color or font size in a widget test, or state shared between tests.

Tags: a11y, ai, best-practices, bloc, claude-code, dart, flutter, i18n, l10n, plugin, skills, state-management, testing, very-good-analysis, very-good-cli

## Install

```sh
git clone https://github.com/VeryGoodOpenSource/vgv-ai-flutter-plugin /tmp/vgv-ai-flutter-plugin && ln -s /tmp/vgv-ai-flutter-plugin/skills/testing ~/.claude/skills/testing
```

## From README

Dart & Flutter Testing VGV testing conventions for Dart and Flutter. The framework APIs are assumed; what follows is the house style layered on top of them. Core Standards Apply these standards to all test work: Descriptive test names — verbose, readable names that describe the behavior; never 'works' or 'renders' Hierarchical group/test structure that reads as natural sentences — top-level group for the class, nested group for the method, test for the behavior (e.g., UserRepository → getUser → returns User when API succeeds) String interpolation for type references — use 'returns $User' not 'returns User' so renames propagate automatically Private mocks per file — declare class MockX extends Mock implements X {} with underscore prefix to prevent cross-file coupling Contained test within groups — all /tearDown calls live inside a group, never at the top level of main() Initialize mutable objects in () with late — declare late MyDep dep; then assign in so each test gets a fresh...

## Links

- HTML page: https://omgskills.com/library/verygoodopensource/vgv-ai-flutter-plugin/skills/testing/
- GitHub: https://github.com/VeryGoodOpenSource/vgv-ai-flutter-plugin
- Author: [@verygoodopensource](https://omgskills.com/library/verygoodopensource/index.md)

## More from this repo

- [accessibility](https://omgskills.com/library/verygoodopensource/vgv-ai-flutter-plugin/skills/accessibility/index.md) — Audits or remediates Flutter widgets against WCAG 2.2 conformance levels A, AA, or AAA across iOS, Android, Web, macOS,...
   - [@verygoodopensource](https://omgskills.com/library/verygoodopensource/index.md) · 173 stars
- [animations](https://omgskills.com/library/verygoodopensource/vgv-ai-flutter-plugin/skills/animations/index.md) — Best practices for Flutter animations using the built-in animation framework, covering implicit animations, explicit...
   - [@verygoodopensource](https://omgskills.com/library/verygoodopensource/index.md) · 173 stars
- [bloc](https://omgskills.com/library/verygoodopensource/vgv-ai-flutter-plugin/skills/bloc/index.md) — Best practices for Bloc state management in Flutter/Dart, covering Cubit versus Bloc, event and state naming, sealed...
   - [@verygoodopensource](https://omgskills.com/library/verygoodopensource/index.md) · 173 stars
