mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:47:34 +00:00
LibJS: Handle PlainMonthDay in the Calendar.prototype getters
This commit is contained in:
parent
b76bae13fd
commit
0cf526d0c4
3 changed files with 25 additions and 8 deletions
|
@ -9,3 +9,16 @@ describe("correct behavior", () => {
|
|||
expect(calendar.month(date)).toBe(7);
|
||||
});
|
||||
});
|
||||
|
||||
describe("errors", () => {
|
||||
test("argument must not be a Temporal.PlainMonthDay object", () => {
|
||||
const calendar = new Temporal.Calendar("iso8601");
|
||||
const plainMonthDay = new Temporal.PlainMonthDay(7, 6);
|
||||
expect(() => {
|
||||
calendar.month(plainMonthDay);
|
||||
}).toThrowWithMessage(
|
||||
TypeError,
|
||||
"Accessing month of PlainMonthDay is ambiguous, use monthCode instead"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue