mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-01 13:49:05 +00:00
LibJS: Implement Temporal.Calendar.prototype.inLeapYear
This commit is contained in:
parent
dd15fc471c
commit
c9ae7e1af1
Notes:
sideshowbarker
2024-07-18 08:26:43 +09:00
Author: https://github.com/IdanHo
Commit: c9ae7e1af1
Pull-request: https://github.com/SerenityOS/serenity/pull/8961
Reviewed-by: https://github.com/linusg ✅
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