flutter-test-discovery
Installation
SKILL.md
Flutter test discovery
Ensure every intended test file actually runs. The runner is a names filter: only files matching *_test.dart are discovered by flutter test with no arguments.
Steps
- When the test counter looks low, list the test directory and check names:
ls test/— any file ending in_tests.dart(plural) will be silently skipped. Completion: you can name every file and whether it ends in_test.dart. - Rename non-conforming files so the suite is discovered:
mv test/acceptance_tests.dart test/acceptance_test.dart. - Re-run the full suite and compare the counter to the expected total. Completion: counter matches; the acceptance file's tests appear in the summary.
- Run a single case while debugging with
flutter test test/<file>_test.dart --plain-name 'TEST-003'.
Reference
- Evidence from this project:
flutter testreported+14while 28 tests existed; the 14 acceptance tests inacceptance_tests.dartwere silently excluded until renamed toacceptance_test.dart. - Per-file runs (
flutter test test/x.dart) work with any name — the discovery gap only bites the full-suite run. - If a full-suite run seems too fast, suspect a name, not the tests.