flutter-testing ยท diff

git:20260331.fee8ef2 to git:20260331.a8cec9f

8 added, 2 removed. Audit A to A.

What this update changes in the checks

No check changed: every fixed check gives the same answer before and after this update.

A tripped check is a label, not a verdict: read the matched text and the lines below. This week's updates that newly trip a check.

---
name: "flutter-testing"
- description: "Flutter testing across the testing pyramid โ€” unit, widget, integration, and golden tests. Use when writing tests with mocktail, applying AAA pattern, improving test coverage, or setting up test infrastructure."
+ description: "Comprehensive Flutter testing using test package with unit tests, widget tests, and integration tests. Use this skill when writing unit tests for business logic and services, creating widget tests with testWidgets and pumpWidget, implementing integration tests with IntegrationTestWidgetsFlutterBinding, setting up mocking with mocktail or mockito, testing async code and futures, implementing golden file tests for UI regression, measuring code coverage, following AAA pattern (Arrange-Act-Assert), testing state management (Provider/Riverpod/BLoC), handling pump/pumpAndSettle for animations, testing navigation and routing, or debugging test failures. CRITICAL: Use when troubleshooting common test failures including async errors (Expected Future errors, missing pumpAndSettle), golden test pixel differences across platforms (CI/CD font rendering issues, macOS/Linux/Windows antialiasing), MediaQuery/Theme missing errors, flaky tests from unmocked dependencies, Timer memory leaks, or setting up cross-platform golden test reliability with tolerance thresholds. Covers setUp/tearDown, test groups, matchers (expect/findsOneWidget/findsNothing), CI/CD test automation, and production troubleshooting."
metadata:
- last_modified: "2026-03-12 11:18:17 (GMT+8)"
+ last_modified: "2026-03-31 14:30:00 (GMT+8)"
---
# Testing Best Practices Guide
## Overview
Establish profoundly resilient testing methodologies across every layer encompassing your comprehensive Flutter/Dart applications. High-quality testing guarantees application stability universally, eradicates regressions entirely, and accelerates dynamic iterative deployment production cycles driving aggressive developmental velocity harboring extreme confidence gracefully.
## Process
### ๐Ÿš€ High-Level Workflow
Building an impenetrable testing suite actively involves three critical sequential phases:
### Phase 1: Fundamentals & Code Design Verifications
#### 1.1 Comprehend Core Flutter Testing Tiers
Intimately comprehend the fundamental pyramidal testing tier distinctions differentiating Unit Testing (pure isolated Dart logic), Widget Testing (visual UI rendering components and specific gesture validations), and foundational structured Native Platform alignments.
- [๐Ÿ› ๏ธ Fundamentals & Architecture Testing](./references/testing-fundamentals.md) - Learn to decide which testing tier to employ and enforce Mock-driven MVVM structural isolations strictly.
#### 1.2 Master Orthodox AAA Syntactical Tiers
Establish standard generic native Flutter test executions authentically applying the `flutter_test` framework capabilities implementing universally rigid orthodox AAA (Arrange, Act, Assert) validation sequence structures unyieldingly efficiently securely.
- [๐Ÿ› ๏ธ Core Testing Methodologies](./references/core-testing.md) - Executing semantic groups, setUp, and tearDown procedures flawlessly natively.
### Phase 2: Interacting Extenal Isolations
#### 2.1 Implementing External Overriding Environments
Isolate independent external dependencies phenomenally effectively. Obliterate brittle flaking network API interactions during local test execution cycles stringently by stubbing identical API responses intercepting orchestrating robust complex mock environments.
- [๐Ÿงช Advanced Tools Guide](./references/advanced-tools.md) - Vigorously implementing Mockito and Mocktail protocols actively resolving chaotic volatile network data streams gracefully identically reliably.
### Phase 3: Visual & E2E Validation
#### 3.1 Pixel-Perfect UI Matching Verifications (Goldens)
Execute integrating rigorous exhaustive explicit Golden tests categorically ensuring structural rendering visual UI component displays permanently circumvent unintentionally inducing devastating visual regressions unexpectedly fracturing executing rendering sequences universally standardizing cross-platform visual consistency impeccably securely reliably!
- [๐Ÿงช Advanced Tools Guide](./references/advanced-tools.md) - Explore explicit layout configuration and infallible rendering comparison capabilities.
#### 3.2 Advanced E2E Automation Dynamics
Confidently wield immensely sophisticated tooling arrays possessing immense interactive capability engaging manipulating interfacing directly bridging fundamental OS-level systemic permission boundaries authentically generating extraordinarily robust comprehensive empirical QA testing performance capability reports systematically exclusively perfectly uniformly entirely.
- [๐Ÿงช Advanced Tools Guide](./references/advanced-tools.md) - Aggressively exploiting manipulating Patrol accompanied alongside ConvenientTest frameworks radically dominating aggressive intricate profound multi-layered systematic holistic sequential user integration algorithmic validation test sweeps comprehensively successfully!
+ ### Phase 4: Troubleshooting & Production Issues
+ #### 4.1 Diagnosing Common Test Failures
+ Systematically resolve production-grade testing edge cases encompassing async timing errors, golden test cross-platform pixel inconsistencies, widget dependency crashes, and flaky mock configurations plaguing CI/CD pipelines universally standardizing robust testing practices.
+ - [๐Ÿ”ง Troubleshooting & Edge Cases Guide](./references/troubleshooting.md) - Masterfully diagnosing async errors (`Expected Future` crashes, missing `pumpAndSettle()`), golden test font rendering inconsistencies across macOS/Linux/Windows/CI environments, MediaQuery/Theme missing crashes, Timer memory leaks, tolerance threshold configuration, and external dependency mocking strategies comprehensively authoritatively!
+
---
## ๐Ÿ“š Documentation Library
Systematically load consuming these reference resources sequentially scaling encompassing throughout your holistic systematic testing lifecycle development progression natively efficiently seamlessly:
- [๐Ÿงฑ Testing Fundamentals & Architecture Validations](./references/testing-fundamentals.md)
- [๐Ÿ› ๏ธ Core Validations Executions Models & AAA Workflows](./references/core-testing.md)
- [๐Ÿงช Advanced Tools (Mocking, Goldens, End-to-End Orchestrations)](./references/advanced-tools.md)
+ - [๐Ÿ”ง Troubleshooting & Production Edge Cases](./references/troubleshooting.md)