mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-08 02:03:34 +08:00
docs(zh-CN): sync Chinese docs with latest upstream changes (#202)
* docs(zh-CN): sync Chinese docs with latest upstream changes * docs: improve Chinese translation consistency in go-test.md * docs(zh-CN): update image paths to use shared assets directory - Update image references from ./assets/ to ../../assets/ - Remove zh-CN/assets directory to use shared assets --------- Co-authored-by: neo <neo.dowithless@gmail.com>
This commit is contained in:
31
docs/zh-CN/rules/common/testing.md
Normal file
31
docs/zh-CN/rules/common/testing.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# 测试要求
|
||||
|
||||
## 最低测试覆盖率:80%
|
||||
|
||||
测试类型(全部需要):
|
||||
|
||||
1. **单元测试** - 单个函数、工具、组件
|
||||
2. **集成测试** - API 端点、数据库操作
|
||||
3. **端到端测试** - 关键用户流程(根据语言选择框架)
|
||||
|
||||
## 测试驱动开发
|
||||
|
||||
强制工作流程:
|
||||
|
||||
1. 先写测试 (失败)
|
||||
2. 运行测试 - 它应该失败
|
||||
3. 编写最小实现 (成功)
|
||||
4. 运行测试 - 它应该通过
|
||||
5. 重构 (改进)
|
||||
6. 验证覆盖率 (80%+)
|
||||
|
||||
## 测试失败排查
|
||||
|
||||
1. 使用 **tdd-guide** 代理
|
||||
2. 检查测试隔离性
|
||||
3. 验证模拟是否正确
|
||||
4. 修复实现,而不是测试(除非测试有误)
|
||||
|
||||
## 代理支持
|
||||
|
||||
* **tdd-guide** - 主动用于新功能,强制执行测试优先
|
||||
Reference in New Issue
Block a user