Flutter testing
Testing Flutter + Riverpod 3 — unit/widget/golden, ProviderContainer.test, provider overrides, mocktail. Apply when writing or reviewing tests in a Flutter project.From its SKILL.md
npx -y skills add Neznakometz/StackForge --skill flutter-testingAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 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
1.6 KB, 355 tokens by cl100k_base, as published. Nobody here has run it
Flutter + Riverpod 3 — testing
Tiers
- unit (
package:test, no Flutter) → widget (testWidgets,flutter_test) → integration (integration_test, device/emulator). - e2e/integration — only critical flows; everything else with unit tests (see the core skill
tdd).
Riverpod
ProviderContainer.test()(v3, auto-disposes at the end). Do NOT share a container between tests.- Value:
container.read(provider); for autoDispose —container.listen(...), read through the subscription. - Async:
await expectLater(container.read(provider.future), completion(...)). - Widget:
ProviderScopeat the root ofpumpWidget, container —tester.container().
Override (everything is mockable with no setup)
provider.overrideWith((ref) => fake);notifierProvider.overrideWithBuild((ref, self) => state)— mock onlybuild, real methods;futureProvider.overrideWithValue(AsyncValue.data(x)).
Mocks
- mocktail (no codegen) — default. Mock the repository that the Notifier uses, not the Notifier itself.
- Golden:
matchesGoldenFile('name.png'), update withflutter test --update-goldens. Run on a single CI image (goldens are sensitive to platform/fonts/version).
Accessibility in tests
meetsGuideline(textContrastGuideline), androidTapTargetGuideline/iOSTapTargetGuideline, labeledTapTargetGuideline — enforce contrast and tap-target size (48×48 Android / 44×44 iOS).
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.
Gives 0 of the 12 instructions most test skills give in 355 tokens
Counted across 964 of the 1,571 authors here whose files we hold, read 2026-08-07
- Close the browser when donein 55 of 964, across 12 files
- Wait for network idle statein 51 of 964, across 6 files
- Launch Chromium in headless modein 49 of 964, across 6 files
- Use descriptive selectors for elementsin 49 of 964, across 6 files
- Run provided scripts with help flag firstin 49 of 964, across 6 files
- Add appropriate explicit waitsin 48 of 964, across 5 files
- Use bundled scripts as black boxesin 46 of 964, across 3 files
- Do not read script source codein 46 of 964, across 3 files
- Use sync playwright for scriptsin 46 of 964, across 3 files
- Inspect dom before executing actionsin 46 of 964, across 3 files
- Run the full test suitein 37 of 964
- Write the failing test firstin 29 of 964, across 23 files
Said here and by no other author read
- cover everything else with unit tests
- create a fresh ProviderContainer for each test
- mock the repository not the notifier
- use mocktail as the default mocking tool
- read autoDispose providers through a subscription
- place ProviderScope at the widget root
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.