LibJS: Implement stringification Temporal.PlainMonthDay prototypes

This commit is contained in:
Timothy Flynn 2024-11-20 14:57:18 -05:00 committed by Tim Flynn
commit 5bccb36a6f
Notes: github-actions[bot] 2024-11-22 00:25:37 +00:00
14 changed files with 238 additions and 7 deletions

View file

@ -57,10 +57,10 @@ describe("normal behavior", () => {
expect(Object.getPrototypeOf(plainMonthDay)).toBe(Temporal.PlainMonthDay.prototype);
});
// FIXME: Re-implement this test with Temporal.PlainMonthDay.prototype.toString({ calendarName: "always" }).
// test("default reference year is 1972", () => {
// const plainMonthDay = new Temporal.PlainMonthDay(7, 6);
// const fields = plainMonthDay.getISOFields();
// expect(fields.isoYear).toBe(1972);
// });
test("default reference year is 1972", () => {
const plainMonthDay = new Temporal.PlainMonthDay(7, 6);
const fields = plainMonthDay.toString({ calendarName: "always" });
const year = fields.split("-")[0];
expect(year).toBe("1972");
});
});