feat(site): build-time man.md fetcher pinned to release ref

This commit is contained in:
Christian Visintin
2026-06-07 21:30:23 +02:00
parent f56dd60868
commit ba513850c1
2 changed files with 74 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import { describe, expect, it } from "vitest";
import { manUrl, MAN_REF } from "./fetch-man.mjs";
describe("manUrl", () => {
it("uses the root man.md for en", () => {
expect(manUrl("en")).toBe(
`https://raw.githubusercontent.com/veeso/termscp/${MAN_REF}/docs/man.md`
);
});
it("uses the per-locale path for non-en", () => {
expect(manUrl("it")).toBe(
`https://raw.githubusercontent.com/veeso/termscp/${MAN_REF}/docs/it/man.md`
);
});
it("pins to a concrete ref, not a moving branch", () => {
expect(MAN_REF).not.toBe("main");
expect(MAN_REF.length).toBeGreaterThan(0);
});
});