mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 06:09:08 +00:00
LibJS: Implement parsing of TemporalInstantString
This commit is contained in:
parent
79a18b058f
commit
783222f87a
Notes:
sideshowbarker
2024-07-18 00:56:06 +09:00
Author: https://github.com/linusg
Commit: 783222f87a
Pull-request: https://github.com/SerenityOS/serenity/pull/10971
Reviewed-by: https://github.com/IdanHo ✅
Reviewed-by: https://github.com/alimpfard
5 changed files with 42 additions and 5 deletions
|
@ -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'");
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue