mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:37:34 +00:00
LibJS: Implement parsing of TemporalCalendarString
This commit is contained in:
parent
1583c7257c
commit
79a18b058f
6 changed files with 33 additions and 9 deletions
|
@ -22,6 +22,6 @@ describe("normal behavior", () => {
|
|||
expect(Temporal.Calendar.from(calendarLike)).toBe(calendarLike);
|
||||
expect(Temporal.Calendar.from(withCalendarLike)).toBe(withCalendarLike.calendar);
|
||||
expect(Temporal.Calendar.from("iso8601").id).toBe("iso8601");
|
||||
// TODO: test Temporal.Calendar.from("TemporalCalendarString") once ParseTemporalCalendarString is working
|
||||
expect(Temporal.Calendar.from("2021-07-06[u-ca=iso8601]").id).toBe("iso8601");
|
||||
});
|
||||
});
|
||||
|
|
|
@ -31,13 +31,11 @@ describe("errors", () => {
|
|||
}).toThrowWithMessage(TypeError, "Not an object of type Temporal.ZonedDateTime");
|
||||
});
|
||||
|
||||
// FIXME: Enable this when calendar string parsing is implemented.
|
||||
test.skip("from invalid calendar string", () => {
|
||||
test("from invalid calendar string", () => {
|
||||
const zonedDateTime = new Temporal.ZonedDateTime(1n, {}, {});
|
||||
|
||||
// FIXME: Use "toThrowWithMessage" once this has an error message.
|
||||
expect(() => {
|
||||
zonedDateTime.withCalendar("iso8602foobar");
|
||||
}).toThrow(RangeError);
|
||||
}).toThrowWithMessage(RangeError, "Invalid calendar string 'iso8602foobar'");
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue