Files
everything-claude-code/docs/zh-CN/rules/testing.md
zdoc 88054de673 docs: Add Chinese (zh-CN) translations for all documentation
* docs: add Chinese versions docs

* update

---------

Co-authored-by: neo <neo.dowithless@gmail.com>
2026-02-05 05:57:54 -08:00

33 lines
763 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 测试要求
## 最低测试覆盖率80%
测试类型(全部需要):
1. **单元测试** - 单个函数、工具、组件
2. **集成测试** - API 端点、数据库操作
3. **端到端测试** - 关键用户流程 (Playwright)
## 测试驱动开发
强制工作流程:
1. 先写测试 (失败)
2. 运行测试 - 它应该失败
3. 编写最小实现 (成功)
4. 运行测试 - 它应该通过
5. 重构 (改进)
6. 验证覆盖率 (80%+)
## 测试失败排查
1. 使用 **tdd-guide** 代理
2. 检查测试隔离性
3. 验证模拟是否正确
4. 修复实现,而不是测试(除非测试有误)
## 代理支持
* **tdd-guide** - 主动用于新功能,强制执行先写测试
* **e2e-runner** - Playwright 端到端测试专家