ladybird/Libraries/LibJS/Tests/builtins/Temporal/Instant/Instant.compare.js
Timothy Flynn 90820873a2 LibJS: Implement the Temporal.Instant constructor
And the simple Temporal.Instant.prototype getters, so that the
constructed Temporal.Instant may actually be validated.
2024-11-25 13:32:58 +01:00

13 lines
505 B
JavaScript

describe("correct behavior", () => {
test("length is 2", () => {
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);
});
});