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

LibJS: Implement Temporal.PlainDate.prototype.withCalendar

This commit is contained in:
Idan Horowitz 2021-07-23 15:01:40 +03:00 committed by Linus Groh
parent 8123e957e3
commit 9fa8f19a0f
4 changed files with 34 additions and 0 deletions

View file

@ -0,0 +1,13 @@
describe("correct behavior", () => {
test("length is 1", () => {
expect(Temporal.PlainDate.prototype.withCalendar).toHaveLength(1);
});
test("basic functionality", () => {
const calendar = { hello: "friends" };
const firstPlainDate = new Temporal.PlainDate(1, 1, 1);
expect(firstPlainDate.calendar).not.toBe(calendar);
const secondPlainDate = firstPlainDate.withCalendar(calendar);
expect(secondPlainDate.calendar).toBe(calendar);
});
});