mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 19:07:34 +00:00
LibJS: Add Temporal.Instant.compare()
This commit is contained in:
parent
b816037739
commit
33cf6274e8
6 changed files with 49 additions and 0 deletions
|
@ -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);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue