LibJS: Handle ZonedDateTime in the various Temporal factories

This commit is contained in:
Timothy Flynn 2024-11-25 07:24:24 -05:00 committed by Andreas Kling
commit 3e6133cc09
Notes: github-actions[bot] 2024-11-26 10:04:16 +00:00
8 changed files with 97 additions and 19 deletions

View file

@ -34,6 +34,11 @@ describe("correct behavior", () => {
expect(result).toBeInstanceOf(Temporal.Instant);
expect(result.epochNanoseconds).toBe(0n);
});
test("ZonedDateTime instance argument", () => {
const zonedDateTime = new Temporal.ZonedDateTime(123n, "UTC");
expect(Temporal.Instant.from(zonedDateTime).epochNanoseconds).toBe(123n);
});
});
describe("errors", () => {