mirror of
https://github.com/sweetwisdom/everything-claude-code-zh.git
synced 2026-03-21 22:10:09 +00:00
docs: 完成所有文档的中文翻译并应用到项目
This commit is contained in:
@@ -1,27 +1,27 @@
|
||||
# Test Coverage
|
||||
# 测试覆盖率 (Test Coverage)
|
||||
|
||||
Analyze test coverage and generate missing tests:
|
||||
分析测试覆盖率并生成缺失的测试用例:
|
||||
|
||||
1. Run tests with coverage: npm test --coverage or pnpm test --coverage
|
||||
1. 运行带覆盖率报告的测试:npm test --coverage 或 pnpm test --coverage
|
||||
|
||||
2. Analyze coverage report (coverage/coverage-summary.json)
|
||||
2. 分析覆盖率报告 (coverage/coverage-summary.json)
|
||||
|
||||
3. Identify files below 80% coverage threshold
|
||||
3. 识别覆盖率低于 80% 阈值的文件
|
||||
|
||||
4. For each under-covered file:
|
||||
- Analyze untested code paths
|
||||
- Generate unit tests for functions
|
||||
- Generate integration tests for APIs
|
||||
- Generate E2E tests for critical flows
|
||||
4. 针对每个覆盖率不足的文件:
|
||||
- 分析未测试的代码路径
|
||||
- 为函数生成单元测试 (Unit Tests)
|
||||
- 为 API 生成集成测试 (Integration Tests)
|
||||
- 为关键流程生成端到端测试 (E2E Tests)
|
||||
|
||||
5. Verify new tests pass
|
||||
5. 验证新测试已通过
|
||||
|
||||
6. Show before/after coverage metrics
|
||||
6. 展示覆盖率指标的前后对比
|
||||
|
||||
7. Ensure project reaches 80%+ overall coverage
|
||||
7. 确保项目整体覆盖率达到 80% 以上
|
||||
|
||||
Focus on:
|
||||
- Happy path scenarios
|
||||
- Error handling
|
||||
- Edge cases (null, undefined, empty)
|
||||
- Boundary conditions
|
||||
重点关注:
|
||||
- 正常路径 (Happy path) 场景
|
||||
- 错误处理 (Error handling)
|
||||
- 边缘情况 (Edge cases) (null, undefined, empty)
|
||||
- 边界条件 (Boundary conditions)
|
||||
|
||||
Reference in New Issue
Block a user