Flutter Test Runner
Instructions
- •
Identify which tests to run:
- •If a specific file was modified, run tests for that file/module
- •If unsure, run all tests with
flutter test - •For a single test file:
flutter test test/path/to/test_file.dart
- •
Run the tests:
bashflutter test --reporter=expanded
- •
Analyze failures:
- •Read the error messages carefully
- •Identify the root cause (logic error, missing mock, incorrect expectation)
- •Suggest specific fixes
- •
For coverage analysis:
bashflutter test --coverage
Examples
Run all tests:
bash
flutter test
Run specific test file:
bash
flutter test test/models/unit_test.dart
Run tests matching a pattern:
bash
flutter test --name "combat"