LibJS: Implement Temporal.Calendar.prototype.inLeapYear

This commit is contained in:
Idan Horowitz 2021-07-23 19:03:19 +03:00 committed by Linus Groh
commit c9ae7e1af1
Notes: sideshowbarker 2024-07-18 08:26:43 +09:00
4 changed files with 43 additions and 0 deletions

View file

@ -0,0 +1,13 @@
describe("correct behavior", () => {
test("length is 1", () => {
expect(Temporal.Calendar.prototype.inLeapYear).toHaveLength(1);
});
test("basic functionality", () => {
const calendar = new Temporal.Calendar("iso8601");
const date = new Temporal.PlainDate(2021, 7, 23);
expect(calendar.inLeapYear(date)).toBeFalse();
const leapDate = new Temporal.PlainDate(2020, 7, 23);
expect(calendar.inLeapYear(leapDate)).toBeTrue();
});
});