Skip to content

Commit 0949091

Browse files
rednebptomato
authored andcommitted
polyfill: add some tests for ISO week number edge cases
1 parent ff3f7ca commit 0949091

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

polyfill/test/calendar.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,10 @@ describe('Calendar', () => {
261261
throws(() => iso.weekOfYear({ year: 2000 }), TypeError);
262262
});
263263
});
264+
describe('edge cases for Calendar.weekOfYear()', () => {
265+
it('week 1 from next year', () => equal(iso.weekOfYear(Temporal.PlainDate.from('2019-12-31')), 1));
266+
it('week 53 from previous year', () => equal(iso.weekOfYear(Temporal.PlainDate.from('2021-01-01')), 53));
267+
});
264268
describe('Calendar.daysInWeek()', () => {
265269
const res = 7;
266270
it('accepts Date', () => equal(iso.daysInWeek(Temporal.PlainDate.from('1994-11-05')), res));

0 commit comments

Comments
 (0)