1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 15:07:45 +00:00

LibJS: Implement Temporal.PlainDate.prototype.toPlainYearMonth()

This commit is contained in:
Linus Groh 2021-08-16 00:42:01 +01:00
parent ed9d37bd40
commit 6709c915aa
6 changed files with 75 additions and 1 deletions

View file

@ -0,0 +1,13 @@
describe("correct behavior", () => {
test("length is 0", () => {
expect(Temporal.PlainDate.prototype.toPlainYearMonth).toHaveLength(0);
});
test("basic functionality", () => {
const plainDate = new Temporal.PlainDate(2021, 7, 6);
const plainYearMonth = plainDate.toPlainYearMonth();
expect(plainYearMonth.calendar).toBe(plainDate.calendar);
expect(plainYearMonth.year).toBe(2021);
expect(plainYearMonth.month).toBe(7);
});
});