Skip to content

Commit a01da7b

Browse files
Array Fleetcursoragent
andcommitted
test(cli): extend smoke coverage for JSON check and shell completions
Assert check --json returns a clean drift report on the fixture scaffold (context/ and patterns/ frontmatter included) and cover zsh/fish completion scripts alongside bash. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 528f8e9 commit a01da7b

1 file changed

Lines changed: 25 additions & 4 deletions

File tree

test/cli-smoke.test.ts

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,19 @@ describe("CLI smoke", () => {
9090
expect(result.stdout.length).toBeGreaterThan(0);
9191
});
9292

93+
it("check --json reports clean drift on fixture scaffold", () => {
94+
const result = runMex(["check", "--json"]);
95+
expectSuccess(result);
96+
const report = JSON.parse(result.stdout) as {
97+
score: number;
98+
issues: Array<{ code?: string; file?: string }>;
99+
filesChecked: number;
100+
};
101+
expect(report.score).toBe(100);
102+
expect(report.issues).toEqual([]);
103+
expect(report.filesChecked).toBeGreaterThanOrEqual(8);
104+
});
105+
93106
it("doctor prints health summary", () => {
94107
const result = runMex(["doctor"]);
95108
expectSuccess(result);
@@ -111,10 +124,18 @@ describe("CLI smoke", () => {
111124
expect(result.stdout).toContain("{");
112125
});
113126

114-
it("completion bash emits script", () => {
115-
const result = runMex(["completion", "bash"]);
116-
expectSuccess(result);
117-
expect(result.stdout).toContain("complete");
127+
it("completion emits scripts for bash, zsh, and fish", () => {
128+
const bash = runMex(["completion", "bash"]);
129+
expectSuccess(bash);
130+
expect(bash.stdout).toContain("complete");
131+
132+
const zsh = runMex(["completion", "zsh"]);
133+
expectSuccess(zsh);
134+
expect(zsh.stdout).toContain("#compdef mex");
135+
136+
const fish = runMex(["completion", "fish"]);
137+
expectSuccess(fish);
138+
expect(fish.stdout).toContain("complete -c mex");
118139
});
119140

120141
it("sync --dry-run runs without error", () => {

0 commit comments

Comments
 (0)