1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 10:18:13 +00:00

LibJS: Implement Temporal.PlainDateTime.prototype.calendar

This commit is contained in:
Linus Groh 2021-07-22 20:01:10 +01:00
parent 78acc976a6
commit aa2c8b6b91
3 changed files with 45 additions and 0 deletions

View file

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