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 <justsisyphus@users.noreply.github.com>
18 lines
480 B
TypeScript
18 lines
480 B
TypeScript
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)
|
|
})
|
|
})
|