Dart Checks 迁移
原名:dart-migrate-to-checks-package
把旧式断言逐步迁移到 package:checks,并保持原测试语义。
中文 Skills 技能说明
适合 Dart 测试代码需要采用新的 checks 写法时使用。技能会先统计现有 matcher、异常断言和异步场景,再分批替换;迁移后必须运行完整测试并检查差异,不能用机械替换改变测试意图或跳过原本失败的用例。
上游能力依据
上游原始适用说明:Replace the usage of expect and similar functions from package:matcher to package:checks equivalents.
上游 SKILL.md 主要章节(保留原文标题):
- Contents
- When to Use This Skill
- How to Use This Skill (The Workflow)
- 1. Dependency Setup
- 2. Identify and Plan Target Files
- 3. Migrating a File (Incremental or Full)
- 4. Verification and Feedback Loops
- Key Syntax Differences and Pitfalls
- 1. Collection Equality Pitfall (equals vs deepEquals)
- 2. The reason Parameter is now because
使用边界
先复现问题并固定测试范围,再生成或执行测试。测试通过只能证明已覆盖的场景,不能代替生产环境验收。
作者、翻译与许可证
- 原作者
- The Flutter Authors 与 flutter/agent-plugins contributors
- 中文翻译
- CEOFans翻译
- 许可证
- BSD-3-Clause
- 上游来源
- https://github.com/flutter/agent-plugins/tree/864cf8797b190ddb81e4875db6dd6bab89641f62/skills/dart-migrate-to-checks-package
适用范围
平台:linux、macos、windows;标签:测试与质量、Dart Checks 迁移
安全提示
基础静态扫描不等于绝对安全。技能可能调用命令、浏览器、云服务或本地文件,请在最小权限环境中使用,高风险操作必须人工确认。
如发现侵权、许可证或安全问题,可在本页前台提交投诉,管理员复核后可立即下架。