test-best-practices
Installation
SKILL.md
When to use this skill
In a Dart or Flutter project. When a user asks to "enforce test best practices" or similar. When modifying or creating test files.
Workflow
- Search: Use the grep commands below to identify candidates.
- Analyze: Check if the code violates the best practices defined below.
- Apply: Refactor the code to use the recommended matchers.
- Verify: Run tests (
dart test) to ensure no regressions.
Search Strategies
.length:grep -r "\.length,\s*equals\(" test/- Boolean properties:
grep -rE "expect\(.*\.(is(Empty|NotEmpty)),\s*(isTrue|true|isFalse|false)" test/ - Manual loops:
grep -r "for (var .* in .*)" test/(manual review required)
Related skills