added missing tests for added loc

This commit is contained in:
yyovil 2026-04-02 01:02:28 +05:30 committed by Gaurav Bhola
parent 482368d15f
commit 2403e17b8f
1 changed files with 14 additions and 0 deletions

View File

@ -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);
});
});