| Metric | Before | After |
|---|---|---|
| Statements | 79.86% | 89.38% |
| Branches | 69.44% | 77.35% |
| Functions | 67.1% | 76.92% |
| Lines | 83.33% | 92.53% |
Total tests: 187 → 233 (+46 new tests).
| Metric | 2026-04-12 | 2026-06-14 | Change |
|---|---|---|---|
| Statements | 74.9% | 89.38% | +14.48% |
| Branches | 67.66% | 77.35% | +9.69% |
| Functions | 62.5% | 76.92% | +14.42% |
| Lines | 78.05% | 92.53% | +14.48% |
- Files that were untested last report and are now covered:
comments.js(0% → 100%),nudges.js(0% → 100%),cronAuth.js(0% → 100%),email.js(0% → 95.23%) streaks.jsimproved from 49% → 91.5% statements- Files that remain untested across multiple weeks:
onboarding.js,partnerships.js,confetti.js,sounds.js
No lib/ files changed in the last 7 days. Targeted lowest-coverage and untested utility files instead.
tests/unit/lib/streaks.test.js— extended with 14 new tests, now covers:formatUTCDate,formatDateInTimezone,getHourInTimezone,calculateStreak,getActivityHeatmaptests/unit/lib/comments.test.js— 14 tests, covers:getComments,getBatchCommentCounts,postComment,deleteCommenttests/unit/lib/nudges.test.js— 5 tests, covers:sendNudge(auth, rate limiting, happy path, insert error, missing profile)tests/unit/lib/cronAuth.test.js— 6 tests, covers:verifyCronSecret(valid token, missing header, missing env, wrong token, wrong length, empty header)tests/unit/lib/email.test.js— 6 tests, covers:sendReminderEmail(happy path, Resend error, network throw, correct recipient, missing userName, XSS escaping)
- Added
limittotests/setup/supabase-mock.jschain methods, enabling tests fornudges.js(which was previously blocked by the missing.limit()support).
lib/FocusContext.js,lib/NotificationContext.js,lib/KeyboardShortcutsContext.js— React context providerslib/animations.js— pure animation data presets, no logic to testlib/supabase/*— Supabase client configurationlib/useKeyboardShortcuts.js,lib/useModalScrollLock.js— React hooks (require component rendering)lib/pactTemplates.js,lib/accentColors.js— already at 100% coveragelib/onboarding.js— requires.upsert()mock support (deferred)lib/partnerships.js— requires.or()and multi-chain builder states (deferred)lib/confetti.js,lib/sounds.js— browser-only side-effect modules (canvas/audio APIs)
streaks.jsuncovered line 131 is abreakinside the current-streak loop when the gap is >1 day; hard to reach since the mock resolves both concurrent queries to the same value (would need per-call builder state). Lines 18-21 are the unexportedformatLocalDatehelper.activity.jsfunction coverage remains at 29% becausefetchProfilesMap(private),isTestActivity(private), and the full happy paths ofgetGroupActivity/getAllActivity/getGroupStatsinvolve multiple sequential Supabase queries with profile/reaction assembly that the shared mock can't differentiate per-table. The exported functions are tested at their error and empty-data boundaries.cronAuth.jsreached 100% coverage by adding a same-length-different-value token test that exercises thetimingSafeEqualfalse branch.- Next week's candidates for coverage improvement:
onboarding.jsandpartnerships.js(require mock helper extension for.upsert()and.or()).