Files

22 lines
709 B
TypeScript
Raw Permalink Normal View History

2026-05-09 17:58:44 +10:00
import fs from "node:fs/promises";
2026-06-30 20:57:55 +10:00
import { describe, it } from "node:test";
import { expect } from "expect";
2026-05-09 17:58:44 +10:00
import { TRUTHMARK_VERSION } from "../src/version.js";
describe("TRUTHMARK_VERSION", () => {
it("is read from package.json so generated workflow staleness markers track releases", async () => {
2026-05-09 17:58:44 +10:00
const packageJson = JSON.parse(
await fs.readFile(new URL("../package.json", import.meta.url), "utf8"),
) as { version: string };
const versionSource = await fs.readFile(
new URL("../src/version.ts", import.meta.url),
"utf8",
);
2026-05-09 17:58:44 +10:00
expect(TRUTHMARK_VERSION).toBe(packageJson.version);
expect(versionSource).not.toContain(`"${packageJson.version}"`);
2026-05-09 17:58:44 +10:00
});
});