Files
everything-claude-code/docs/zh-TW/commands/test-coverage.md
Dave Lin c3430bdc8a docs: add Traditional Chinese translation
Complete Traditional Chinese (zh-TW) translation of documentation
2026-01-28 23:06:29 -08:00

28 lines
653 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.
# 測試覆蓋率
分析測試覆蓋率並產生缺少的測試:
1. 執行帶覆蓋率的測試npm test --coverage 或 pnpm test --coverage
2. 分析覆蓋率報告coverage/coverage-summary.json
3. 識別低於 80% 覆蓋率閾值的檔案
4. 對每個覆蓋不足的檔案:
- 分析未測試的程式碼路徑
- 為函式產生單元測試
- 為 API 產生整合測試
- 為關鍵流程產生 E2E 測試
5. 驗證新測試通過
6. 顯示前後覆蓋率指標
7. 確保專案達到 80% 以上整體覆蓋率
專注於:
- 正常流程情境
- 錯誤處理
- 邊界情況null、undefined、空值
- 邊界條件