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…

MITAuto-check passedMobile

Install Testing

skills CLI
$ npx skills add VeryGoodOpenSource/vgv-ai-flutter-plugin --skill testing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install VeryGoodOpenSource/vgv-ai-flutter-plugin testing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/VeryGoodOpenSource/vgv-ai-flutter-plugin.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/testing .claude/skills/testing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
testing
GitHub stars
170
Token cost
~3.2k tokens
SKILL.md length
946 words
Files
10 (incl. references)
Skills in repo
15
Repo updated
First seen
Licence
MIT

At a glance

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…

  • Reviewing tests
  • SKILL.md covers Core Standards, File Organization, Group and Test Hierarchy and Test Isolation, plus 3 more sections
  • Calls flutter and dart
  • Goldens included

What it does

Testing is an agent skill from VeryGoodOpenSource/vgv-ai-flutter-plugin. 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:fluttertest, package:mocktail, or package:bloctest, 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…

Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 11 other files, including reference files (for example `agents/openai.yaml`, `references/animation-testing.md` and `references/configuration.md`).

It sits in Mobile, covering Cross-platform mobile apps and Unit testing. It works with Flutter and Dart. The repository describes itself as: AI plugin to enhance and accelerate Flutter & Dart development, built by Very Good Ventures. The licence is MIT.

When your agent uses it

  • Reviewing tests
  • Goldens included
  • That use package:test
  • Package:fluttertest

Example prompts

  • “Dart code only”
  • “/testing”

Requirements

  • Pre-approved tools (allowed-tools): Read, Glob, Grep, mcp__very-good-cli__test

What it can do on your machine

Read from SKILL.md and the folder at commit 496a3c6. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Glob
    • Grep
    • mcp__very-good-cli__test

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • flutter
    • dart

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Testing loads about 3.2k tokens when it runs, and up to ~10k if it reads all its reference files. Until then it costs about 228 tokens; SKILL.md has 946 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~228
When it runs · the whole SKILL.md, loaded when a task matches
~3.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~10k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from VeryGoodOpenSource/vgv-ai-flutter-plugin at commit 496a3c6, republished under its MIT licence (© VeryGoodOpenSource). 946 words, ~3,152 tokens.

Download SKILL.mdSave it as .claude/skills/testing/SKILL.md (or your agent's skills folder). This skill also uses 9 other files; get the full folder from GitHub.
name
testing
description
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.
allowed-tools
Read, Glob, Grep, mcp__very-good-cli__test
argument-hint
file-or-directory

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 setup within groups — all setUp/tearDown calls live inside a group, never at the top level of main()
  • Initialize mutable objects in setUp() with late — declare late MyDep dep; then assign in setUp so each test gets a fresh instance
  • No shared mutable state between tests — never use static members, global variables, or top-level final instances that persist across tests
  • Use package:mocktail — never package:mockito
  • Constant test tags — use an abstract class TestTag with static const fields; never pass raw string literals as tags
  • Test behavior, not properties — widget tests focus on functional outcomes; static visual properties validated via golden tests
  • Use pumpApp test helper — wrap widgets via shared helper in test/helpers/pump_app.dart; never inline pumpWidget(MaterialApp(...))
  • Tag all golden tests — annotate with TestTag.golden so goldens can run/update independently
  • Pass directory to the test MCP tool when the project is not at the workspace root — monorepos with the Flutter project in a subdirectory (e.g. mobile/) require directory: 'mobile'; omit it only when pubspec.yaml is at the workspace root
  • Pass timeout_seconds to the test MCP tool — Flutter tests can hang indefinitely when pumpAndSettle() is called without a timeout; set a cap (e.g. timeout_seconds: 120) so the run is killed instead of stalling
  • Cross-harness fallback for the test MCP tool — on Claude Code use mcp__very-good-cli__test; on a host without this plugin's Bash hooks and without that MCP server connected, run very_good test (or flutter test / dart test) directly with the same coverage and timeout options — never block on a missing MCP server

File Organization

ConventionRule
File suffixEvery test file ends with _test.dart
DirectoryAll tests live under test/
Mirror structuretest/ mirrors lib/ exactly — lib/src/models/user.dart → test/src/models/user_test.dart
HelpersShared test utilities go in test/helpers/ (e.g., pump_app.dart, fakes.dart)

Group and Test Hierarchy

Structure groups so that concatenated descriptions read as natural sentences. Use the PascalCase type itself — not a string — in the top-level group.

dart
class _MockApiClient extends Mock implements ApiClient {}

void main() {
  group(UserRepository, () {
    late ApiClient apiClient;
    late UserRepository subject;

    setUp(() {
      apiClient = _MockApiClient();
      subject = UserRepository(apiClient: apiClient);
    });

    group('getUser', () {
      test('returns $User when API call succeeds', () async {
        when(() => apiClient.fetchUser(any()))
            .thenAnswer((_) async => User(id: '1', name: 'Dash'));

        final result = await subject.getUser('1');

        expect(result, equals(User(id: '1', name: 'Dash')));
        verify(() => apiClient.fetchUser('1')).called(1);
      });

      test('throws $UserNotFoundException when API returns 404', () {
        when(() => apiClient.fetchUser(any()))
            .thenThrow(ApiException(statusCode: 404));

        expect(
          () => subject.getUser('1'),
          throwsA(isA<UserNotFoundException>()),
        );
      });
    });
  });
}
Naming Conventions
PatternExample
Returns a value'returns $User when API call succeeds'
Throws an exception'throws $UserNotFoundException when user is not found'
Calls a dependency'calls apiClient.deleteUser with correct id'
Emits states'emits [loading, success] when data is fetched'
Conditional behavior'returns cached value when cache is not expired'
Edge case'returns empty list when repository has no items'

Test Isolation

Each test must pass when run individually, in any order, and in parallel. Use --test-randomize-ordering-seed random to expose hidden dependencies.

Anti-PatternProblemCorrect Approach
setUp at the top level of main()Breaks when test runner merges files for optimizationMove setUp inside a group
final dep = _MockDep(); (top-level)Same instance shared across all tests; state leaksUse late + setUp inside a group
class MockDep extends Mock (public)Other test files can import and depend on itUse class _MockDep extends Mock (private)
Static/global mutable variablesState persists across testsReset in setUp or avoid entirely
Tests that must run in a specific orderFragile, fails with random orderingMake each test fully self-contained
Show full SKILL.md (349 more words)Show less

Testing Private Logic

Never test private methods directly. Exercise private logic through the public method that uses it:

dart
// If _normalizeEmail is private, test it through the public createUser method:
test('normalizes email to lowercase before saving', () async {
  when(() => repository.save(any())).thenAnswer((_) async {});

  await subject.createUser(email: 'Dash@Example.COM');

  final captured = verify(() => repository.save(captureAny())).captured;
  expect(captured.first.email, equals('dash@example.com'));
});

Widget Testing

RuleDetails
Use testWidgetsEvery widget test uses testWidgets instead of test
Prefer find.byTypeDefault finder; use find.text for user-visible content, find.byKey only when type/text is ambiguous
Group by behavior categoryUse renders, navigates, calls [MethodName], updates as nested group names
Focus on behaviorAssert what the widget does (shows text, calls callback, navigates); use golden tests for visual appearance
Mock Blocs and CubitsUse MockBloc/MockCubit from package:bloc_test; never provide real Blocs in widget tests
Prefer pump() over pumpAndSettle()pumpAndSettle hangs on infinite animations such as CircularProgressIndicator
pumpApp Helper

Every widget test wraps the widget under test through one shared helper, so no test inlines its own MaterialApp:

dart
// test/helpers/pump_app.dart
extension PumpApp on WidgetTester {
  Future<void> pumpApp(Widget widget) {
    return pumpWidget(
      MaterialApp(
        home: widget,
      ),
    );
  }
}

Export it from test/helpers/helpers.dart so every test imports it with one line:

dart
import '../helpers/helpers.dart';

void main() {
  group(MyWidget, () {
    testWidgets('renders greeting text', (tester) async {
      await tester.pumpApp(const MyWidget());

      expect(find.text('Hello'), findsOneWidget);
    });
  });
}
Widget Testing Anti-Patterns
Anti-PatternProblemCorrect Approach
Inline MaterialApp in each testDuplicated boilerplate; inconsistent setupUse pumpApp helper
find.byKey as default finderCouples tests to implementation keysPrefer find.byType or find.text
Testing padding, colors, or font sizesFragile; breaks on every design tweak; asserts appearance, not behaviorUse a golden test for visual validation
Missing pump() after interactionWidget tree does not rebuild; assertion sees stale stateAlways pump() after tap, enterText, etc.
Real Blocs in widget testsTests become integration tests; slow, brittle, hard to isolateUse MockBloc/MockCubit from bloc_test

Padding, background color, and font size are the recurring temptation. Asserting them in a widget test couples the test to the design system and breaks on every restyle — move them to a golden test tagged TestTag.golden.

Additional Resources

© VeryGoodOpenSource, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 9 other files (references) in skills/testing of VeryGoodOpenSource/vgv-ai-flutter-plugin.

  • SKILL.md
  • agents/openai.yaml
  • references/animation-testing.md
  • references/configuration.md
  • references/coverage.md
  • references/golden-tests.md
  • references/matchers.md
  • references/mocktail.md
  • references/test-patterns.md
  • references/widget-tests.md

Open the folder on GitHubat commit 496a3c6

Compare with similar skills

Testing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Testing this skillVeryGoodOpenSource/vgv-ai-flutter-plugin170—~3.2kAutomated safety check: PassMIT
Dart Lifecycle Disposed Flag Overloaddivinevideo/divine-mobile266—~2kAutomated safety check: PassMPL-2.0
Flutter TestingMADTeacher/mad-agents-skills110—~1.5kAutomated safety check: PassMIT
Testingevanca/flutter-ai-rules650—~1.1kAutomated safety check: PassMIT
Native Testing Strategybladeofgod/flutter-ai-harness116—~345Automated safety check: PassMIT
Flutter TesterFNOSP/FlyNarwhal496—~1.4kAutomated safety check: PassAGPL-3.0

Similar skills

  • Dart Lifecycle Disposed Flag Overload

    divinevideo/divine-mobile

    Fix Dart/Flutter services where calling start() after stop() is a silent no-op because stop() sets a disposed (or similar) flag that start()'s guard short-circuits on.

    266 GitHub stars~2k tokensUpdated today
    MobileAuto-check passed
  • Flutter Testing

    MADTeacher/mad-agents-skills

    Write, fix, review, debug, and validate Flutter tests for apps, packages, and plugins.

    110 GitHub stars~1.5k tokensUpdated 5 mo ago
    Testing & QAAuto-check passed
  • Testing

    evanca/flutter-ai-rules

    A skill your agent uses when writing or reviewing Flutter/Dart tests (unit, widget, golden), fixing flaky tests, adding coverage, or choosing between unit and widget tests.

    650 GitHub stars~1.1k tokensUpdated 25 days ago
    Testing & QAAuto-check passed
  • Native Testing Strategy

    bladeofgod/flutter-ai-harness

    适用:设计或审查 Kotlin/Swift 原生模块、Bridge Adapter、Host 编译、模拟器/设备和系统能力验证。不适用:纯 Dart/Flutter 测试或用 Fake 代替相机和权限真机验证。触发词:JUnit、XCTest、Robolectric、instrumented test、Swift Testing、Framework Fake、Gradle…

    116 GitHub stars~345 tokensUpdated 1 mo ago
    MobileAuto-check passed
  • Flutter Tester

    FNOSP/FlyNarwhal

    A skill your agent uses when creating, writing, fixing, or reviewing tests in a Flutter project.

    496 GitHub stars~1.4k tokensUpdated today
    MobileAuto-check passed
  • Flutter MCP E2E Harness

    Arenukvern/mcp_flutter

    A skill your agent uses when writing or running repeatable E2E scenarios for Flutter apps as checked-in Dart with the fluttermcpharness package (packages/harness) — build/launch the app, attach to…

    386 GitHub stars~2.2k tokensUpdated 6 days ago
    MobileAuto-check passed

More from VeryGoodOpenSource/vgv-ai-flutter-plugin

All 15 skills in this repo
  • Accessibility

    VeryGoodOpenSource/vgv-ai-flutter-plugin

    Audits or remediates Flutter widgets against WCAG 2.2 conformance levels A, AA, or AAA across iOS, Android, Web, macOS, Windows, and Linux, covering Semantics labels and screen reader output under…

    170 GitHub stars~4.2k tokensUpdated 3 days ago
    Auto-check passed
  • Animations

    VeryGoodOpenSource/vgv-ai-flutter-plugin

    Best practices for Flutter animations using the built-in animation framework, covering implicit animations, explicit AnimationController animations, page transitions, and Material 3 motion tokens.

    170 GitHub stars~3.5k tokensUpdated 3 days ago
    Auto-check passed
  • Bloc

    VeryGoodOpenSource/vgv-ai-flutter-plugin

    Best practices for Bloc state management in Flutter/Dart, covering Cubit versus Bloc, event and state naming, sealed classes with Equatable, the Page/View split with BlocProvider, BlocBuilder…

    170 GitHub stars~2k tokensUpdated 3 days ago
    Auto-check passed
  • Dart Flutter SDK Upgrade

    VeryGoodOpenSource/vgv-ai-flutter-plugin

    VGV-specific reference for bumping Dart and Flutter SDK constraints across packages, covering pubspec.yaml environment constraints, CI workflow Flutter versions, and SDK upgrade PR preparation.

    170 GitHub stars~2.6k tokensUpdated 3 days ago
    Auto-check: notes
  • Internationalization

    VeryGoodOpenSource/vgv-ai-flutter-plugin

    Best practices for internationalization (i18n) and localization (l10n) in Flutter, using the built-in flutterlocalizations and intl setup with ARB files as the single source of truth.

    170 GitHub stars~1.6k tokensUpdated 3 days ago
    Auto-check passed
  • Layered Architecture

    VeryGoodOpenSource/vgv-ai-flutter-plugin

    VGV layered monorepo architecture in Flutter: four layers Data, Repository, Business Logic, and Presentation, unidirectional dependency rules, and model transformation across layers.

    170 GitHub stars~4.6k tokensUpdated 3 days ago
    Auto-check passed

Works with

Questions about Testing

What does Testing do?

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…. Testing is an agent skill from VeryGoodOpenSource/vgv-ai-flutter-plugin. 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.

When should I use Testing?

Testing fits situations like: reviewing tests; goldens included; that use package:test; package:fluttertest.

How do I install Testing in Claude Code?

Run `npx skills add VeryGoodOpenSource/vgv-ai-flutter-plugin --skill testing -a claude-code`. Or copy the skill folder (skills/testing in VeryGoodOpenSource/vgv-ai-flutter-plugin) into .claude/skills/testing in your project. Claude Code loads it when a task matches its description.

How do I install Testing in Codex?

Run `npx skills add VeryGoodOpenSource/vgv-ai-flutter-plugin --skill testing -a codex`. Or copy the skill folder (skills/testing in VeryGoodOpenSource/vgv-ai-flutter-plugin) into .agents/skills/testing in your project. Codex loads it when a task matches its description.

Can I use Testing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add VeryGoodOpenSource/vgv-ai-flutter-plugin --skill testing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/testing, .gemini/skills/testing, .github/skills/testing and .opencode/skills/testing in your project.

What does Testing need to run?

Going by SKILL.md and its folder, Testing needs the command-line tools its instructions call (flutter and dart). Its frontmatter pre-approves these tools: Read, Glob, Grep, mcp__very-good-cli__test.

Does Testing access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Testing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Testing use?

Testing is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Testing use?

About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 6.9k tokens, read only when the agent opens those files.

What are the alternatives to Testing?

Skills that share tags, products or a category with Testing: Dart Lifecycle Disposed Flag Overload (divinevideo/divine-mobile, 266 stars), Flutter Testing (MADTeacher/mad-agents-skills, 110 stars), Testing (evanca/flutter-ai-rules, 650 stars) and Native Testing Strategy (bladeofgod/flutter-ai-harness, 116 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Testing?

VeryGoodOpenSource (a GitHub organization) maintains it in VeryGoodOpenSource/vgv-ai-flutter-plugin, which has 170 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on October 6, 2026.

Source: VeryGoodOpenSource/vgv-ai-flutter-plugin on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.