From 2403e17b8ffdbfeb95c916722a89c2b4eaa2ca09 Mon Sep 17 00:00:00 2001 From: yyovil Date: Thu, 2 Apr 2026 01:02:28 +0530 Subject: [PATCH] added missing tests for added loc --- packages/cli/__tests__/options/version.test.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 packages/cli/__tests__/options/version.test.ts diff --git a/packages/cli/__tests__/options/version.test.ts b/packages/cli/__tests__/options/version.test.ts new file mode 100644 index 000000000..71e2cc140 --- /dev/null +++ b/packages/cli/__tests__/options/version.test.ts @@ -0,0 +1,14 @@ +import { describe, expect, it } from "vitest"; +import { execFileSync } from "node:child_process"; +import { fileURLToPath } from "node:url"; +import packageJson from "../../package.json" with { type: "json" }; + +describe("ao --version", () => { + it("matches the CLI package version", () => { + const tsxEntry = fileURLToPath(new URL("../../node_modules/.bin/tsx", import.meta.url)); + const cliEntry = fileURLToPath(new URL("../../src/index.ts", import.meta.url)); + const output = execFileSync(tsxEntry, [cliEntry, "--version"], { encoding: "utf8" }).trim(); + + expect(output).toBe(packageJson.version); + }); +});