From 56f3dcb432cba69b7232e5ec515cafef4bbb509d Mon Sep 17 00:00:00 2001 From: Sanchit Rk <0xsanchit@gmail.com> Date: Tue, 13 Oct 2026 15:14:39 +0530 Subject: [PATCH] test(cli): normalise the version in the tui managed artifact The snapshot recorded the CLI version, so it went stale on every bump. It now records when the registered version matches the package. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 4 ++++ packages/codework/test/__artifacts__/tui.managed.json | 2 +- packages/codework/test/tui.test.ts | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ccc752d1..1d621ad2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ This file is the canonical source for unreleased changes and published release n ## [Unreleased] +### Internal + +- The `codework tui` E2E artifact now records the CLI version as ``, so it no longer goes stale on every version bump. + ## [@codeworksh/cli@0.2.0] - 2026-10-12 ### Added diff --git a/packages/codework/test/__artifacts__/tui.managed.json b/packages/codework/test/__artifacts__/tui.managed.json index 7d3020d6..6ebdf723 100644 --- a/packages/codework/test/__artifacts__/tui.managed.json +++ b/packages/codework/test/__artifacts__/tui.managed.json @@ -1,7 +1,7 @@ { "serviceJson": { "pid": "", - "version": "0.1.0", + "version": "", "url": "ws://127.0.0.1:7601/rpc/v1", "port": 7601 }, diff --git a/packages/codework/test/tui.test.ts b/packages/codework/test/tui.test.ts index 92181b78..7cabe764 100644 --- a/packages/codework/test/tui.test.ts +++ b/packages/codework/test/tui.test.ts @@ -9,6 +9,9 @@ import { afterEach, describe, expect, it } from "vite-plus/test"; const cli = fileURLToPath(new URL("../src/index.ts", import.meta.url)); const models = fileURLToPath(new URL("../../../models.gen.json", import.meta.url)); +const { version } = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")) as { + version: string; +}; /** * A stand-in for the Rust TUI. It writes what the launcher gave it to its own @@ -192,7 +195,7 @@ describe("codework tui", () => { await expect( JSON.stringify( { - serviceJson: { ...info, pid: "" }, + serviceJson: { ...info, pid: "", version: info.version === version ? "" : info.version }, tui: { ...message, home: message.home === dir ? "" : message.home,