Skip to content

Commit 439c6c4

Browse files
DrBaherclaude
andcommitted
test: guard SIGN_CLI_VERSION + server.json against package.json drift
sign-cli reports its version from three hand-bumped spots (SIGN_CLI_VERSION and two server.json fields) that drifted before (stuck at 0.6.4 while shipping 0.6.5). Pin all three to package.json so a release that misses one fails CI. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 7e577f5 commit 439c6c4

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

src/tests/version-sync.test.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// sign-cli reports its version from three hand-bumped spots that have drifted
2+
// before (SIGN_CLI_VERSION was stuck at 0.6.4 while the package shipped 0.6.5).
3+
// Pin all of them to package.json so a release that misses one fails CI.
4+
import test from "node:test";
5+
import assert from "node:assert/strict";
6+
import { readFileSync } from "node:fs";
7+
import { fileURLToPath } from "node:url";
8+
import { dirname, join } from "node:path";
9+
import { SIGN_CLI_VERSION } from "../lib/help-catalog.js";
10+
11+
// dist/tests/version-sync.test.js -> repo root is two levels up.
12+
const root = join(dirname(fileURLToPath(import.meta.url)), "..", "..");
13+
const pkg = JSON.parse(readFileSync(join(root, "package.json"), "utf8"));
14+
const server = JSON.parse(readFileSync(join(root, "server.json"), "utf8"));
15+
16+
test("SIGN_CLI_VERSION matches package.json", () => {
17+
assert.equal(SIGN_CLI_VERSION, pkg.version);
18+
});
19+
20+
test("server.json versions match package.json", () => {
21+
assert.equal(server.version, pkg.version);
22+
assert.equal(server.packages[0].version, pkg.version);
23+
});

0 commit comments

Comments
 (0)