Files
oh-my-pi/scripts/ci-release-checksums.test.ts
T
Andrew Fischer 5da9525afd ci(release): add SHA256SUMS.txt to GitHub releases
Generate a sha256sum-compatible checksums file covering every release
binary and the browser-relay zip, and upload it as a release asset so
downloads can be verified offline without hitting the GitHub API.
2026-08-04 15:38:18 -07:00

17 lines
591 B
TypeScript

import { describe, expect, it } from "bun:test";
import { formatChecksums } from "./ci-release-checksums";
describe("formatChecksums", () => {
it("sorts entries by basename and formats as `sha256sum -c`-compatible lines", () => {
const output = formatChecksums([
{ name: "omp-linux-x64", sha256: "b".repeat(64) },
{ name: "omp-darwin-arm64", sha256: "a".repeat(64) },
]);
expect(output).toBe(`${"a".repeat(64)} omp-darwin-arm64\n${"b".repeat(64)} omp-linux-x64\n`);
});
it("returns an empty string for no entries", () => {
expect(formatChecksums([])).toBe("");
});
});