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

LibJS: Add Temporal.Instant.compare()

This commit is contained in:
Idan Horowitz 2021-07-11 21:18:48 +03:00 committed by Linus Groh
parent b816037739
commit 33cf6274e8
6 changed files with 49 additions and 0 deletions

View file

@ -0,0 +1,13 @@
describe("correct behavior", () => {
test("length is 1", () => {
expect(Temporal.Instant.compare).toHaveLength(2);
});
test("basic functionality", () => {
const instant1 = new Temporal.Instant(111n);
expect(Temporal.Instant.compare(instant1, instant1)).toBe(0);
const instant2 = new Temporal.Instant(999n);
expect(Temporal.Instant.compare(instant1, instant2)).toBe(-1);
expect(Temporal.Instant.compare(instant2, instant1)).toBe(1);
});
});