Skip to content

test: 程式碼.js branch gaps + re-ratchet thresholds to 95/90/95/95 (#107 P1) - #157

Merged
cheerc merged 1 commit into
mainfrom
test/107-p1-backend-branches
Jun 24, 2026
Merged

test: 程式碼.js branch gaps + re-ratchet thresholds to 95/90/95/95 (#107 P1)#157
cheerc merged 1 commit into
mainfrom
test/107-p1-backend-branches

Conversation

@cheerc

@cheerc cheerc commented Jun 24, 2026

Copy link
Copy Markdown
Owner

What

Fill backend branch coverage gaps in 程式碼.js and re-ratchet coverage thresholds. Part of #107 Phase 2 P1.

Part 1: Branch Gap Fill

Added 2 new test cases in backend.test.js:

Gap Line Test Description
L458 copySchedule Source ID not in Data index _findScheduleRowInfo returns -1 for nonexistent source
L542-543 getVersionData Empty history sheet lastRow < 2 (header only, no data rows)

Part 2: Threshold Re-Ratchet

Metric Old New Actual
Statements 67% 95% 98.55%
Branches 74% 90% 94.09%
Functions 82% 95% 98.93%
Lines 67% 95% 99.45%

Changed Files (2)

  • vitest.config.js (threshold re-ratchet)
  • tests/unit/backend.test.js (+2 tests)

Verification

  • npm test: 1156 tests passed (37 files) ✅
  • npx vitest run --coverage: all thresholds pass ✅

refs #107

…107 P1)

Add 2 new backend branch gap tests:
- copySchedule: source ID not found in Data index (L458)
- getVersionData: empty history sheet, lastRow < 2 (L542-543)

Re-ratchet coverage thresholds from 67/74/82/67 to 95/90/95/95:
- Overall branch: 77.38% → 94.09%
- Statements: 70.71% → 98.55%
- Functions: 84.94% → 98.93%
- Lines: 70.06% → 99.45%

All 1156 tests pass. Coverage thresholds pass.

refs #107

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

Agend-Agent: cb-team-impl
Agend-Task: t-20260624115456258169-40473-34
Agend-Branch: test/107-p1-backend-branches
Agend-Issued-At: 2026-06-24T11:55:26.618170+00:00
@cheerc

cheerc commented Jun 24, 2026

Copy link
Copy Markdown
Owner Author

✅ VERIFIED

Reviewed HEAD: 465076c
Reviewer: cb-team-reviewer
Audit mode: fast_path (D1 — test-only)

Files Reviewed (2)

  • vitest.config.js — threshold re-ratchet 67/74/82/67 → 95/90/95/95
  • tests/unit/backend.test.js (+32) — 2 branch gap tests

Fast Path Checklist

Evidence

  • cited: vitest.config.js — lines:95, functions:95, branches:90, statements:95
  • cited: backend.test.js:145-155 — getVersionData empty history test
  • cited: backend.test.js:273-293 — copySchedule not-found test

@cheerc
cheerc merged commit 8fd5cae into main Jun 24, 2026
1 check passed
@cheerc
cheerc deleted the test/107-p1-backend-branches branch June 24, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant