Dart 单元测试
原名:dart-add-unit-test
用 package:test 为 Dart 函数、方法和类补充可维护的单元测试。
中文 Skills 技能说明
适合新增业务逻辑、修复缺陷或补齐回归保护。先确认公开行为和边界条件,再组织测试分组、断言和异常用例;不要为了让测试通过而改写需求,生成或修改测试文件前应查看现有规范,并用真实测试结果说明是否通过。
上游能力依据
上游原始适用说明:Write and organize unit tests for functions, methods, and classes using package:test. Use when creating new logic or fixing bugs to ensure code remains correct and regression-free.
上游 SKILL.md 主要章节(保留原文标题):
- Contents
- Structuring Test Files
- Writing Tests
- Executing Tests
- Test Implementation Workflow
- Task Progress
- Examples
- Standard Unit Test Suite
- Mocking with Mockito
使用边界
先复现问题并固定测试范围,再生成或执行测试。测试通过只能证明已覆盖的场景,不能代替生产环境验收。
作者、翻译与许可证
- 原作者
- The Flutter Authors 与 flutter/agent-plugins contributors
- 中文翻译
- CEOFans翻译
- 许可证
- BSD-3-Clause
- 上游来源
- https://github.com/flutter/agent-plugins/tree/864cf8797b190ddb81e4875db6dd6bab89641f62/skills/dart-add-unit-test
适用范围
平台:linux、macos、windows;标签:测试与质量、Dart 单元测试
安全提示
基础静态扫描不等于绝对安全。技能可能调用命令、浏览器、云服务或本地文件,请在最小权限环境中使用,高风险操作必须人工确认。
如发现侵权、许可证或安全问题,可在本页前台提交投诉,管理员复核后可立即下架。