1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:47:34 +00:00

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
parent dd15fc471c
commit c9ae7e1af1
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();
});
});