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

LibJS: Implement parsing of TemporalInstantString

This commit is contained in:
Linus Groh 2021-11-20 16:50:56 +00:00
parent 79a18b058f
commit 783222f87a
5 changed files with 42 additions and 5 deletions

View file

@ -14,10 +14,17 @@ describe("correct behavior", () => {
expect(Temporal.Instant.from(zonedDateTime).epochNanoseconds).toBe(123n);
});
// Un-skip once ParseISODateTime & ParseTemporalTimeZoneString are implemented
test.skip("Instant string argument", () => {
test("Instant string argument", () => {
expect(Temporal.Instant.from("1975-02-02T14:25:36.123456789Z").epochNanoseconds).toBe(
160583136123456789n
);
});
});
describe("errors", () => {
test("invalid instant string", () => {
expect(() => {
Temporal.Instant.from("foo");
}).toThrowWithMessage(RangeError, "Invalid instant string 'foo'");
});
});