Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Feb 20, 2025
1 parent 7cae866 commit 934d528
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions js-rattler/src/Version.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,4 +251,19 @@ describe("Version", () => {
expect(new Version("1.2.3a").withAlpha().toString()).toBe("1.2.3a");
});
});


describe("compare", () => {
it("should compare version with expected order", () => {
expect(
new Version("1.2.3").compare(new Version("1.2.3")),
).toBe(0);
expect(
new Version("1.2.0").compare(new Version("1.2.3")),
).toBe(-1);
expect(
new Version("1.2.4").compare(new Version("1.2.3")),
).toBe(1);
});
});
});

0 comments on commit 934d528

Please sign in to comment.