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

LibJS: Implement Temporal.PlainYearMonth.prototype.equals

This commit is contained in:
Luke Wilde 2021-09-09 03:53:47 +01:00 committed by Linus Groh
parent ff0b01a505
commit 58e2597dc2
3 changed files with 47 additions and 0 deletions

View file

@ -0,0 +1,15 @@
describe("correct behavior", () => {
test("length is 1", () => {
expect(Temporal.PlainYearMonth.prototype.equals).toHaveLength(1);
});
test("basic functionality", () => {
const calendar = { hello: "friends" };
const firstPlainDateTime = new Temporal.PlainYearMonth(1, 1, calendar);
const secondPlainDateTime = new Temporal.PlainYearMonth(0, 1, calendar);
expect(firstPlainDateTime.equals(firstPlainDateTime)).toBeTrue();
expect(secondPlainDateTime.equals(secondPlainDateTime)).toBeTrue();
expect(firstPlainDateTime.equals(secondPlainDateTime)).toBeFalse();
expect(secondPlainDateTime.equals(firstPlainDateTime)).toBeFalse();
});
});