Skip to content

Commit 9a199ec

Browse files
that-github-userunknownclaude
authored
Add CLI integration smoke tests (#129)
* Add CLI integration smoke tests (#79) Test that each CLI command starts and is wired up correctly by invoking the actual CLI via child_process exec. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add integration tests for CLI commands end-to-end Smoke tests verifying each CLI command starts and is wired up: --version, --help, run --help, apply --help, config list, clean. 6 new integration tests using child_process exec. Closes #79 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: unknown <that-github-user@github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f13edc4 commit 9a199ec

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

src/integration.test.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import assert from "node:assert/strict";
2+
import { exec as execCb } from "node:child_process";
3+
import { describe, it } from "node:test";
4+
import { promisify } from "node:util";
5+
6+
const exec = promisify(execCb);
7+
const CLI = "npx tsx src/cli.ts";
8+
9+
describe("CLI integration (smoke tests)", () => {
10+
it("--version outputs version number", async () => {
11+
const { stdout } = await exec(`${CLI} --version`);
12+
assert.match(stdout.trim(), /^\d+\.\d+\.\d+$/);
13+
});
14+
15+
it("--help shows all commands", async () => {
16+
const { stdout } = await exec(`${CLI} --help`);
17+
assert.ok(stdout.includes("Ensemble AI coding"));
18+
assert.ok(stdout.includes("run"));
19+
assert.ok(stdout.includes("apply"));
20+
assert.ok(stdout.includes("list"));
21+
assert.ok(stdout.includes("stats"));
22+
assert.ok(stdout.includes("clean"));
23+
assert.ok(stdout.includes("undo"));
24+
assert.ok(stdout.includes("config"));
25+
});
26+
27+
it("run --help shows options", async () => {
28+
const { stdout } = await exec(`${CLI} run --help`);
29+
assert.ok(stdout.includes("--attempts"));
30+
assert.ok(stdout.includes("--model"));
31+
assert.ok(stdout.includes("--scoring"));
32+
});
33+
34+
it("apply --help shows options", async () => {
35+
const { stdout } = await exec(`${CLI} apply --help`);
36+
assert.ok(stdout.includes("--agent"));
37+
assert.ok(stdout.includes("--preview"));
38+
assert.ok(stdout.includes("--dry-run"));
39+
});
40+
41+
it("config list runs without error", async () => {
42+
const { stdout } = await exec(`${CLI} config list`);
43+
assert.ok(stdout.includes("attempts") || stdout.includes("model"));
44+
});
45+
46+
it("clean runs without error", async () => {
47+
await exec(`${CLI} clean`);
48+
});
49+
});

0 commit comments

Comments
 (0)