mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-03 14:50:18 +00:00
LibJS: Implement Temporal.PlainYearMonth.prototype.daysInMonth
This commit is contained in:
parent
1f1d7144bf
commit
703eb1f7b4
Notes:
sideshowbarker
2024-07-18 07:13:01 +09:00
Author: https://github.com/linusg
Commit: 703eb1f7b4
Pull-request: https://github.com/SerenityOS/serenity/pull/9273
Reviewed-by: https://github.com/IdanHo ✅
3 changed files with 32 additions and 0 deletions
|
@ -0,0 +1,14 @@
|
|||
describe("correct behavior", () => {
|
||||
test("basic functionality", () => {
|
||||
const plainYearMonth = new Temporal.PlainYearMonth(2021, 7);
|
||||
expect(plainYearMonth.daysInMonth).toBe(31);
|
||||
});
|
||||
});
|
||||
|
||||
describe("errors", () => {
|
||||
test("this value must be a Temporal.PlainYearMonth object", () => {
|
||||
expect(() => {
|
||||
Reflect.get(Temporal.PlainYearMonth.prototype, "daysInMonth", "foo");
|
||||
}).toThrowWithMessage(TypeError, "Not a Temporal.PlainYearMonth");
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue