1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 18:57:36 +00:00

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

This commit is contained in:
Linus Groh 2021-08-23 23:23:53 +01:00 committed by Andreas Kling
parent ed5ae7b093
commit 5573efa3bd
3 changed files with 42 additions and 0 deletions

View file

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