Files
everything-claude-code/rules/zh/testing.md
xingzihai da74f85c10 fix: address review feedback from PR #929
- Add missing code-review.md and development-workflow.md to zh/README.md directory listing
- Add mkdir -p command before copy in manual install instructions
- Fix TypeScript test command path in SKILL-DEVELOPMENT-GUIDE.md
- Add Anti-Patterns section to SKILL.md template
- Add Template category to Skill Categories table in CONTRIBUTING.md
- Add Pre-Review Requirements section to code-review.md (both en and zh)
- Add Pre-Review Checks step to development-workflow.md (both en and zh)
- Add trailing newlines to all files that were missing them
2026-03-26 04:37:08 +00:00

709 B
Raw Blame History

测试要求

最低测试覆盖率80%

测试类型(全部必需):

  1. 单元测试 - 单个函数、工具、组件
  2. 集成测试 - API 端点、数据库操作
  3. E2E 测试 - 关键用户流程(框架根据语言选择)

测试驱动开发

强制工作流:

  1. 先写测试RED
  2. 运行测试 - 应该失败
  3. 编写最小实现GREEN
  4. 运行测试 - 应该通过
  5. 重构IMPROVE
  6. 验证覆盖率80%+

测试失败排查

  1. 使用 tdd-guide 代理
  2. 检查测试隔离
  3. 验证模拟是否正确
  4. 修复实现,而非测试(除非测试有误)

代理支持

  • tdd-guide - 主动用于新功能,强制先写测试