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

LibJS: Implement Temporal.PlainMonthDay.prototype.equals

This commit is contained in:
Luke Wilde 2021-09-10 17:45:32 +01:00 committed by Linus Groh
parent 2d5b15295a
commit 3548b08de2
3 changed files with 47 additions and 0 deletions

View file

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