Commit 9d86140
committed
test: Achieve 100% branch coverage for streak calculation functions
- Add 19 comprehensive test cases for calculateStreak and checkAndAwardAchievements
- Cover all edge cases: empty arrays, consecutive dates, gaps, duplicates, invalid dates
- Set up Jest configuration with Babel and jsdom support
- Use date-fns for consistent date mocking across all tests
- Achieve 100% branch coverage for both target functions1 parent 14751b0 commit 9d86140
7 files changed
Lines changed: 953 additions & 206 deletions
File tree
- .vscode
- src/hooks
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
0 commit comments