返回 Skill 列表
extension
分类: 开发与工程无需 API Key

flutter-test

运行Flutter测试并分析结果。在实现游戏逻辑、修复错误或验证更改时使用。触发词包括“运行测试”、“测试这个”、“验证”、“检查是否有效”。

person作者: jakexiaohubgithub

Flutter Test Runner

Instructions

  1. 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
  2. Run the tests:

    flutter test --reporter=expanded
    
  3. Analyze failures:

    • Read the error messages carefully
    • Identify the root cause (logic error, missing mock, incorrect expectation)
    • Suggest specific fixes
  4. For coverage analysis:

    flutter test --coverage
    

Examples

Run all tests:

flutter test

Run specific test file:

flutter test test/models/unit_test.dart

Run tests matching a pattern:

flutter test --name "combat"