mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:37:35 +00:00
LibJS: Implement Temporal.PlainDate.prototype.inLeapYear
This commit is contained in:
parent
c9ae7e1af1
commit
1d76be97f5
5 changed files with 45 additions and 0 deletions
|
@ -0,0 +1,16 @@
|
|||
describe("correct behavior", () => {
|
||||
test("basic functionality", () => {
|
||||
const date = new Temporal.PlainDate(2021, 7, 23);
|
||||
expect(date.inLeapYear).toBeFalse();
|
||||
const leapDate = new Temporal.PlainDate(2020, 7, 23);
|
||||
expect(leapDate.inLeapYear).toBeTrue();
|
||||
});
|
||||
});
|
||||
|
||||
test("errors", () => {
|
||||
test("this value must be a Temporal.PlainDate object", () => {
|
||||
expect(() => {
|
||||
Reflect.get(Temporal.PlainDate.prototype, "inLeapYear", "foo");
|
||||
}).toThrowWithMessage(TypeError, "Not a Temporal.PlainDate");
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue