From c9b86b78157e4ff4a121a385b587b3310d8f33ab Mon Sep 17 00:00:00 2001 From: justsisyphus Date: Mon, 26 Jan 2026 17:00:55 +0900 Subject: [PATCH] test(cli): add version display test to verify package.json reading (#1134) Closes #1063 Investigation findings: - The CLI code correctly reads version from package.json - The reported issue (bunx showing old version) is a caching issue - Added test to ensure version is read as valid semver from package.json Co-authored-by: justsisyphus --- src/cli/index.test.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/cli/index.test.ts diff --git a/src/cli/index.test.ts b/src/cli/index.test.ts new file mode 100644 index 000000000..9d44a6969 --- /dev/null +++ b/src/cli/index.test.ts @@ -0,0 +1,17 @@ +import { describe, it, expect } from "bun:test" +import packageJson from "../../package.json" with { type: "json" } + +describe("CLI version", () => { + it("reads version from package.json as valid semver", () => { + //#given + const semverRegex = /^\d+\.\d+\.\d+(-[\w.]+)?$/ + + //#when + const version = packageJson.version + + //#then + expect(version).toMatch(semverRegex) + expect(typeof version).toBe("string") + expect(version.length).toBeGreaterThan(0) + }) +})