shed-testing

Guides writing and running Flutter tests for Shed Book across domain, data, widget, and policy tiers.

Updated Jul 27, 2026
Ready to run
npx skills add https://github.com/zakariaf/Shed-Book --skill shed-testing-zakariaf
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: shed-testing
Source: https://github.com/zakariaf/Shed-Book/tree/main/.claude/skills/shed-testing
Command: npx skills add https://github.com/zakariaf/Shed-Book --skill shed-testing-zakariaf

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? It tells you exactly where a test belongs, how to pin time, which fakes and harness to use, and which executable gates (tap targets, semantics, contrast, overflow matrix) must pass when testing the Shed Book Flutter app. ## Core Features & Use Cases - Test placement and naming rules: Maps tests to the R57 tier tree (domain, data, drift, design, features, policy) with property-based naming and the mandatory flutter_test import. - Time and timezone handling: Explains the single appNow() clock, atFixed versus pump for elapsed time, and the uk-zone DST tests run under three TZ settings. - Harness and gates: Points to references/harness.md for testDatabase, the seven fakes, and pumpApp, and documents the 252-cell overflow matrix, 60pt tap-target guideline, and the golden-test policy that forbids --update-goldens. - Use Case: You need to add a widget test for a new screen — the skill tells you to add a kPumpableVariants entry, use pumpApp with a required db, and never clamp textScaler to make a cell pass. ## Quick Start Ask the assistant to write a widget test for a Shed Book screen following the shed-testing rules, using pumpApp and the harness fakes.

Frequently Asked Questions about shed-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a widget test for a Flutter screen in this project?▼

Use tester.pumpApp with a required db parameter, which builds the tree with the correct device, textScaler, locale en_GB, and non-zero padding. Get the database from testDatabase() and pass fakes through the overrides parameter, never overriding repository providers or controllers.

How do I test time-dependent Flutter code without flaky tests?▼

Use the single appNow() clock: atFixed for single-instant assertions, or seed data offset in the past and call pump for elapsed-time assertions. Never construct FakeAsync or use DateTime.now(), and add a uk-zone tagged case in the 01:00-01:59 ambiguous hour.

Why does flutter test fail with a pending timer error in widget tests?▼

The database was not created with closeStreamsSynchronously: true, so an unsubscribed drift stream leaks an extra event-loop turn. Always obtain databases through testDatabase() in test/support/harness.dart, which sets this flag and registers db.close.

Can I run flutter test --update-goldens to fix a failing golden test?▼

No. A red golden is a failing test until a human reviews the diff images in failures/, and a PreToolUse hook blocks the flag. Re-baselining is a separate developer-invoked skill with its own commit; report the failure instead of regenerating.

Should I use mocktail or hand-written fakes for Flutter repository tests?▼

Use the seven hand-written fakes in test/support/ that implement each gateway, so signature changes become compile errors. mocktail is reserved for verifyNever and cross-seam ordering checks only, and repositories are never mocked — tests run against real in-memory SQLite.

What tap target size should Flutter accessibility tests assert?▼

Assert the shedTapTargetGuideline at 60x60, not the Android 48 or iOS 44 guidelines, which sit below this product's floor. Always call tester.ensureSemantics() first, and keep the deliberate 40x40 canary failing to prove the gate is alive.