Commit c89a578
authored
test(cache): verify TTLCache throws RangeError for negative TTL (JhaSourav07#1398) (JhaSourav07#1883)
## Description
Added a specific test case in lib/cache.test.ts to verify that setting a
cache value with a negative TTL (e.g., -5000) correctly throws a
RangeError. This improves test coverage for boundary inputs and ensures
the TTLCache implementation behaves safely under extreme values,
satisfying all acceptance criteria for the issue.
Fixes JhaSourav07#1398
## Pillar
- [ ] 🎨 Pillar 1 — New Theme Design
- [ ] 📐 Pillar 2 — Geometric SVG Improvement
- [ ] 🕐 Pillar 3 — Timezone Logic Optimization
- [x] 🛠️ Other (Bug fix, refactoring, docs)
## Visual Preview
<img width="947" height="420" alt="Screenshot 2026-05-31 005643"
src="https://github.com/user-attachments/assets/15dd2a6f-f510-49cd-bccb-f76657b3f4e2"
/>
## Checklist before requesting a review:
[x] I have read the CONTRIBUTING.md file.
[x] I have tested these changes locally
(localhost:3000/api/streak?user=YOUR_USERNAME).
[x] I have run npm run format and npm run lint locally and resolved all
errors (CI will fail otherwise).
[x] My commits follow the Conventional Commits format (e.g.,
feat(themes): ..., fix(calculate): ...).
[x] I have updated README.md if I added a new theme or URL parameter.
[x] I have started the repo.
[x] I have made sure that i have only one commit to merge in this PR.
[x] The SVG output matches the CommitPulse "premium quality" aesthetic
standard (no raw elements, smooth animations, correct fonts).
[x] (Recommended) I joined the CommitPulse Discord community for
contributor discussions, mentorship, and faster PR support.1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
429 | 436 | | |
430 | 437 | | |
431 | 438 | | |
| |||
473 | 480 | | |
474 | 481 | | |
475 | 482 | | |
| 483 | + | |
476 | 484 | | |
477 | 485 | | |
478 | 486 | | |
| |||
0 commit comments