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

LibJS: Implement Temporal.TimeZone.from()

This commit is contained in:
Linus Groh 2021-07-31 21:39:36 +01:00
parent 28b1e66b51
commit f987c11464
3 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,15 @@
describe("normal behavior", () => {
test("length is 1", () => {
expect(Temporal.TimeZone.from).toHaveLength(1);
});
test("basic functionality", () => {
const timeZone = new Temporal.TimeZone("UTC");
const timeZoneLike = {};
const zonedDateTimeLike = { timeZone: {} };
expect(Temporal.TimeZone.from(timeZone)).toBe(timeZone);
expect(Temporal.TimeZone.from(timeZoneLike)).toBe(timeZoneLike);
expect(Temporal.TimeZone.from(zonedDateTimeLike)).toBe(zonedDateTimeLike.timeZone);
// TODO: test from("string") once ParseTemporalTimeZoneString is working
});
});