1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:57:35 +00:00

LibJS: Implement Temporal.PlainDate.prototype.daysInMonth

This commit is contained in:
Idan Horowitz 2021-07-23 18:38:28 +03:00 committed by Linus Groh
parent 69c8b8e8bd
commit 3160540d0e
5 changed files with 43 additions and 0 deletions

View file

@ -0,0 +1,14 @@
describe("correct behavior", () => {
test("basic functionality", () => {
const date = new Temporal.PlainDate(2021, 7, 23);
expect(date.daysInMonth).toBe(31);
});
});
test("errors", () => {
test("this value must be a Temporal.PlainDate object", () => {
expect(() => {
Reflect.get(Temporal.PlainDate.prototype, "daysInMonth", "foo");
}).toThrowWithMessage(TypeError, "Not a Temporal.PlainDate");
});
});