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

LibJS: Throw on conversion from TimeZone to Calendar and vice versa

This is a normative change in the Temporal spec.

See: 2084e77
This commit is contained in:
Linus Groh 2022-12-01 16:07:13 +01:00
parent ca038c1a4e
commit b0e7d59b8b
5 changed files with 60 additions and 10 deletions

View file

@ -43,3 +43,15 @@ describe("normal behavior", () => {
expect(madeObservableHasPropertyLookup).toBeFalse();
});
});
describe("errors", () => {
test("Calendar from TimeZone", () => {
const timeZone = new Temporal.TimeZone("UTC");
expect(() => {
Temporal.Calendar.from(timeZone);
}).toThrowWithMessage(
RangeError,
"Got unexpected TimeZone object in conversion to Calendar"
);
});
});