TheVicky1 / TheVicky1/Pact_OS

test: add leap year unit test to habit streak test suite

Open Beginner friendly
#39 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Open tests/habits-routines.test.ts.
  2. Locate the streak calculation test block.
  3. Add a test case using sample dates across 2024-02-28, 2024-02-29, and 2024-03-01.
  4. Assert that calculateHabitStreak computes a streak count of 3.

✅ Acceptance criteria

  • Leap year streak test case added to tests/habits-routines.test.ts.
  • Test passes when running npm test.

🧪 Verification

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.