1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:37:45 +00:00

LibJS: Implement Temporal.PlainDate.prototype.calendar

This commit is contained in:
Idan Horowitz 2021-07-19 00:40:14 +03:00 committed by Linus Groh
parent 94e1324a67
commit 94322ea985
3 changed files with 47 additions and 0 deletions

View file

@ -0,0 +1,15 @@
describe("correct behavior", () => {
test("basic functionality", () => {
const calendar = { hello: "friends" };
const plain_date = new Temporal.PlainDate(1, 1, 1, calendar);
expect(plain_date.calendar).toBe(calendar);
});
});
test("errors", () => {
test("this value must be a Temporal.Duration object", () => {
expect(() => {
Reflect.get(Temporal.PlainDate.prototype, "calendar", "foo");
}).toThrowWithMessage(TypeError, "Not a Temporal.PlainDate");
});
});