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

LibJS: Implement Temporal.PlainDateTime.prototype.withCalendar

This commit is contained in:
Idan Horowitz 2021-07-31 01:29:41 +03:00 committed by Linus Groh
parent 4c4482c7f6
commit f657c86d58
3 changed files with 33 additions and 0 deletions

View file

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