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

LibJS: Implement Temporal.ZonedDateTime.prototype.calendar

This commit is contained in:
Linus Groh 2021-08-01 18:08:45 +01:00
parent bc416ab802
commit d022b74d33
3 changed files with 49 additions and 0 deletions

View file

@ -0,0 +1,16 @@
describe("correct behavior", () => {
test("basic functionality", () => {
const timeZone = new Temporal.TimeZone("UTC");
const calendar = new Temporal.Calendar("iso8601");
const zonedDateTime = new Temporal.ZonedDateTime(0n, timeZone, calendar);
expect(zonedDateTime.calendar).toBe(calendar);
});
});
test("errors", () => {
test("this value must be a Temporal.ZonedDateTime object", () => {
expect(() => {
Reflect.get(Temporal.ZonedDateTime.prototype, "calendar", "foo");
}).toThrowWithMessage(TypeError, "Not a Temporal.ZonedDateTime");
});
});