Skip to content

Commit 49f8744

Browse files
authored
test(cli): normalise the version in the tui managed artifact (#73)
The snapshot recorded the CLI version, so it went stale on every bump. It now records <version> when the registered version matches the package.
1 parent 00b59cb commit 49f8744

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ This file is the canonical source for unreleased changes and published release n
1111

1212
## [Unreleased]
1313

14+
### Internal
15+
16+
- The `codework tui` E2E artifact now records the CLI version as `<version>`, so it no longer goes stale on every version bump.
17+
1418
## [@codeworksh/cli@0.2.0] - 2026-10-12
1519

1620
### Added

‎packages/codework/test/__artifacts__/tui.managed.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"serviceJson": {
33
"pid": "<pid>",
4-
"version": "0.1.0",
4+
"version": "<version>",
55
"url": "ws://127.0.0.1:7601/rpc/v1",
66
"port": 7601
77
},

‎packages/codework/test/tui.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import { afterEach, describe, expect, it } from "vite-plus/test";
99

1010
const cli = fileURLToPath(new URL("../src/index.ts", import.meta.url));
1111
const models = fileURLToPath(new URL("../../../models.gen.json", import.meta.url));
12+
const { version } = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")) as {
13+
version: string;
14+
};
1215

1316
/**
1417
* A stand-in for the Rust TUI. It writes what the launcher gave it to its own
@@ -192,7 +195,7 @@ describe("codework tui", () => {
192195
await expect(
193196
JSON.stringify(
194197
{
195-
serviceJson: { ...info, pid: "<pid>" },
198+
serviceJson: { ...info, pid: "<pid>", version: info.version === version ? "<version>" : info.version },
196199
tui: {
197200
...message,
198201
home: message.home === dir ? "<home>" : message.home,

0 commit comments

Comments
 (0)