test: add leap year unit test to habit streak test suite
Open
Beginner friendly
Nobody has claimed this yet.
accessibility
area:testing
beginner friendly
community
contributions-welcome
difficulty:beginner
difficulty:easy
enhancement
good first issue
help wanted
type:test
up-for-grabs
- Dominant language
- TypeScript
- Stars
- 5
- Forks
- 7
- Avg merge
- 39m
- Merged PRs (30d)
- 39
Description
🎯 What needs to be done
Add a unit test in tests/habits-routines.test.ts verifying that daily habit streaks calculate consecutively across Feb 28 -> Feb 29 -> Mar 1 in leap years (e.g. 2024 or 2028).
Why this matters
Guarantees that streak calculation engines and calendar day difference helpers do not break or reset due to leap year date boundaries.
📍 Where to work
tests/habits-routines.test.ts
🧭 Implementation guidance
- Open
tests/habits-routines.test.ts. - Locate the streak calculation test block.
- Add a test case using sample dates across
2024-02-28,2024-02-29, and2024-03-01. - Assert that
calculateHabitStreakcomputes a streak count of3.
✅ Acceptance criteria
- Leap year streak test case added to
tests/habits-routines.test.ts. - Test passes when running
npm test.
🧪 Verification
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open tests/habits-routines.test.ts and locate the streak calculation test block. Add a unit test using 2024-02-28, 2024-02-29, and 2024-03-01, asserting that calculateHabitStreak returns 3. Run npm test and confirm the new test passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 92/100