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:
parent
dd15fc471c
commit
c9ae7e1af1
4 changed files with 43 additions and 0 deletions
|
@ -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();
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue