Skip to content

Commit

Permalink
Add test for year week constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Boddy committed Sep 7, 2022
1 parent ec87e1f commit 8378c2b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Week.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ describe('Week', ()=>{
const week = new Week('1969-12-29');
expect(week.weekSinceEpoch).toBe(0)
})
// Year week constructor
it("Week 36 of 2022",()=>{
const week = new Week(2022, 36);
expect(week.weekSinceEpoch).toBe(2749)
})
/*
Weeks in the year are indexed from 1, like days in a month, because everyone else does it this way.
Weeks since the epoch are indexed from 0, like months. 1970 has 53 weeks, (0 - 52 in weeksSinceEpoch)
Expand Down

0 comments on commit 8378c2b

Please sign in to comment.