LibJS: Stub out Temporal.ZonedDateTime.prototype.getTimeZoneTransition

We will have to add facilities to determine next/previous time zone
transitions. Ideally, ICU can provide this.
This commit is contained in:
Timothy Flynn 2024-11-25 13:51:48 -05:00 committed by Andreas Kling
commit b95528d7b5
Notes: github-actions[bot] 2024-11-26 10:03:09 +00:00
8 changed files with 133 additions and 0 deletions

View file

@ -0,0 +1,19 @@
describe("correct behavior", () => {
test("length is 1", () => {
expect(Temporal.ZonedDateTime.prototype.getTimeZoneTransition).toHaveLength(1);
});
test("basic functionality", () => {
const zonedDateTime = new Temporal.ZonedDateTime(1627318123456789000n, "UTC", "iso8601");
expect(zonedDateTime.getTimeZoneTransition("next")).toBeNull();
expect(zonedDateTime.getTimeZoneTransition("previous")).toBeNull();
});
});
describe("errors", () => {
test("this value must be a Temporal.TimeZone object", () => {
expect(() => {
Temporal.ZonedDateTime.prototype.getTimeZoneTransition.call("foo");
}).toThrowWithMessage(TypeError, "Not an object of type Temporal.ZonedDateTime");
});
});