| 1 | import { expect, it } from "vite-plus/test"; |
| 2 | import { latestForkRelease } from "./forkUpdateDirectory.ts"; |
| 3 | |
| 4 | it("selects the newest immutable release regardless of upload completion order", () => { |
| 5 | const listing = { |
| 6 | files: [ |
| 7 | { href: "0.0.2000000001.json" }, |
| 8 | { href: "0.0.2000000000.json" }, |
| 9 | { href: "0.0.3000000000.json.PARTIAL" }, |
| 10 | { href: "../0.0.4000000000.json" }, |
| 11 | { href: "0.0.5000000000-mac.yml" }, |
| 12 | ], |
| 13 | }; |
| 14 | expect(latestForkRelease(listing)).toBe("0.0.2000000001"); |
| 15 | expect(latestForkRelease({ files: [] })).toBeUndefined(); |
| 16 | }); |