mirror of
https://github.com/sweetwisdom/everything-claude-code-zh.git
synced 2026-03-22 06:20:10 +00:00
fix: restore missing files (package.json etc) and fix sync script logic
This commit is contained in:
27
docs/zh-TW/commands/test-coverage.md
Normal file
27
docs/zh-TW/commands/test-coverage.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# 測試覆蓋率
|
||||
|
||||
分析測試覆蓋率並產生缺少的測試:
|
||||
|
||||
1. 執行帶覆蓋率的測試:npm test --coverage 或 pnpm test --coverage
|
||||
|
||||
2. 分析覆蓋率報告(coverage/coverage-summary.json)
|
||||
|
||||
3. 識別低於 80% 覆蓋率閾值的檔案
|
||||
|
||||
4. 對每個覆蓋不足的檔案:
|
||||
- 分析未測試的程式碼路徑
|
||||
- 為函式產生單元測試
|
||||
- 為 API 產生整合測試
|
||||
- 為關鍵流程產生 E2E 測試
|
||||
|
||||
5. 驗證新測試通過
|
||||
|
||||
6. 顯示前後覆蓋率指標
|
||||
|
||||
7. 確保專案達到 80% 以上整體覆蓋率
|
||||
|
||||
專注於:
|
||||
- 正常流程情境
|
||||
- 錯誤處理
|
||||
- 邊界情況(null、undefined、空值)
|
||||
- 邊界條件
|
||||
Reference in New Issue
Block a user