From 5a47f502a3b47c319589d45dbbde36006e69038b Mon Sep 17 00:00:00 2001 From: JSONbored <49853598+JSONbored@users.noreply.github.com> Date: Tue, 14 Jul 2026 14:32:20 -0700 Subject: [PATCH] fix(test): stop hardcoding the current miner version as a golden value test/unit/miner-cli.test.ts asserted the CLI's --version output and packages/loopover-miner/package.json's version equal a literal "2.0.0", so the test broke on every miner version bump (confirmed live on the miner-v3.0.0 release PR, #5736). packages/loopover-mcp's equivalent test (mcp-cli-basics.test.ts) already reads its package.json version dynamically -- match that pattern here so this compares the CLI's resolved version against the real current package.json version instead of a frozen literal, which is what both tests' own names already claimed to check. --- test/unit/miner-cli.test.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/unit/miner-cli.test.ts b/test/unit/miner-cli.test.ts index 6f2c366c4a..5e003d8f94 100644 --- a/test/unit/miner-cli.test.ts +++ b/test/unit/miner-cli.test.ts @@ -101,7 +101,10 @@ describe("loopover-miner CLI helpers", () => { "../../packages/loopover-miner/package.json", { with: { type: "json" } } ); - expect(packageJson.default.version).toBe("2.0.0"); + const { resolveMinerVersion } = await import( + "../../packages/loopover-miner/lib/version.js" + ); + expect(resolveMinerVersion({})).toBe(packageJson.default.version); }); }); @@ -318,9 +321,13 @@ describe("loopover-miner startup update check (#2331)", () => { ); }); - it("serves --version without blocking when update checks are disabled", () => { + it("serves --version without blocking when update checks are disabled", async () => { + const packageJson = await import( + "../../packages/loopover-miner/package.json", + { with: { type: "json" } } + ); const output = runCapture(["--version", "--no-update-check"]); - expect(output).toContain("@loopover/miner/2.0.0"); + expect(output).toContain(`@loopover/miner/${packageJson.default.version}`); }); it("serves --help immediately without waiting for a slow registry check", async () => {