1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 19:47:34 +00:00

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

This commit is contained in:
Idan Horowitz 2021-08-27 16:50:01 +03:00 committed by Linus Groh
parent 9ed877e8e7
commit 32fc81c186
3 changed files with 40 additions and 0 deletions

View file

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