test: weekly coverage improvement 2026-05-03#73
Conversation
- Extended streaks.test.js with 18 new tests (formatDateInTimezone, getHourInTimezone, getActivityHeatmap) - Added comments.test.js (15 tests), nudges.test.js (5 tests), cronAuth.test.js (7 tests) - Coverage: statements 79.86% → 89.50%, lines 83.33% → 92.63% - All 233 tests pass Co-Authored-By: Claude Scheduled Task <noreply@anthropic.com> https://claude.ai/code/session_01XY753w1FZKHJi6YZ8Guo4B
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
toLocaleString with hour12:false returns 24 (not 0) for midnight in some Node.js/ICU versions. Accept both values in the assertion. https://claude.ai/code/session_01XY753w1FZKHJi6YZ8Guo4B
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb263cb2eb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| describe('formatDateInTimezone', () => { | ||
| it('returns YYYY-MM-DD in UTC by default', () => { | ||
| const date = new Date('2024-06-15T23:30:00Z'); | ||
| expect(formatDateInTimezone(date)).toBe('2024-06-15'); |
There was a problem hiding this comment.
Remove ICU-dependent
YYYY-MM-DD string assertions
These expectations hard-code the exact output format of toLocaleDateString('en-CA'), which is not stable across ICU/Node runtime versions. In environments where en-CA renders as M/D/YYYY, these tests will fail even when timezone conversion logic is correct, creating false negatives in CI. Consider asserting the date value via Intl.DateTimeFormat(...).formatToParts() (year/month/day parts) or normalizing parsed components before comparison.
Useful? React with 👍 / 👎.
Weekly Test Coverage
Automated PR from the Sunday coverage task.
What changed
streaks.test.jswith 18 new tests coveringformatDateInTimezone,getHourInTimezone,getActivityHeatmap, and additionalcalculateStreakedge casescomments.test.js— 15 tests coveringgetComments,getBatchCommentCounts,postComment,deleteCommentnudges.test.js— 5 tests coveringsendNudge(auth, rate limiting, happy path, errors)cronAuth.test.js— 7 tests coveringverifyCronSecret(valid token, missing header/env, wrong token, wrong length)docs/reports/coverage-2026-05-03.mdCoverage improvements
Key file improvements:
streaks.js49% → 93%,comments.js0% → 100%,nudges.js0% → 100%,cronAuth.js0% → 100%.Test results
All 233 tests pass. See the coverage report for full before/after metrics.
Scope
Tests follow the existing Vitest + happy-dom conventions in
tests/unit/lib/. React components, context providers, and animation presets are out of scope for this task.https://claude.ai/code/session_01XY753w1FZKHJi6YZ8Guo4B
Generated by Claude Code