Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mskelton committed Mar 21, 2024
1 parent 90107f4 commit 759e784
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/specs/outdated.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,4 +247,15 @@ test("isVersionOutdated", () => {
expect(isVersionOutdated("1.0.1-rc.1", "1.0.0")).toBe(false)
expect(isVersionOutdated("1.0.1-rc.1", "1.0.0-rc.1")).toBe(false)
expect(isVersionOutdated("1.0.1-rc.1", "1.0.1-rc.1")).toBe(false)

// https://semver.org
expect(isVersionOutdated("1.0.0-alpha", "1.0.0-alpha")).toBe(false)
expect(isVersionOutdated("1.0.0-alpha.1", "1.0.0-alpha.1")).toBe(false)
expect(isVersionOutdated("1.0.0-alpha.1", "1.0.0-alpha.2")).toBe(true)
expect(isVersionOutdated("1.0.0-0.3.7", "1.0.0-0.3.7")).toBe(false)
expect(isVersionOutdated("1.0.0-0.3.7", "1.0.0-0.4.7")).toBe(true)
expect(isVersionOutdated("1.0.0-x.7.z.92", "1.0.0-x.7.z.92")).toBe(false)
expect(isVersionOutdated("1.0.0-x.7.z.92", "1.0.0-x.7.z.93")).toBe(true)
expect(isVersionOutdated("1.0.0-x.7.z.92", "1.0.0-x.8.z.92")).toBe(true)
expect(isVersionOutdated("1.0.0-x.y.z", "1.0.0-x.y.z")).toBe(false)
})

0 comments on commit 759e784

Please sign in to comment.