fix(cli): fail commands returning projected analysis errors (#506)
Signed-off-by: Rudy Celekli <47457359+rudycelekli@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import { describe, expect } from "vitest";
|
||||
|
||||
import { cliTest } from "../../support/cli/cliFixture.js";
|
||||
|
||||
describe("projected CLI failures", () => {
|
||||
cliTest(
|
||||
"exits unsuccessfully for invalid replay configuration",
|
||||
async ({ cli }) => {
|
||||
const result = await cli.run({
|
||||
arguments: ["run-controlled-replay", "{}", "--json"],
|
||||
environment: { REA_JAVASCRIPT_REPLAY_ENABLED: "not-a-bool" },
|
||||
});
|
||||
expect(result.json).toMatchObject({
|
||||
code: "configuration_invalid",
|
||||
category: "execution_failure",
|
||||
retryable: false,
|
||||
});
|
||||
expect(result.exitCode).toBe(1);
|
||||
},
|
||||
);
|
||||
|
||||
cliTest(
|
||||
"exits unsuccessfully for invalid managed reconstruction input",
|
||||
async ({ cli }) => {
|
||||
const result = await cli.run({
|
||||
arguments: ["import-managed-reconstruction", "{}", "--json"],
|
||||
});
|
||||
expect(result.json).toMatchObject({ code: "invalid_request" });
|
||||
expect(result.exitCode).toBe(1);
|
||||
},
|
||||
);
|
||||
|
||||
cliTest(
|
||||
"keeps successful target-free inventory commands successful",
|
||||
async ({ cli }) => {
|
||||
const result = await cli.run({ arguments: ["capabilities", "--json"] });
|
||||
expect(result.exitCode).toBe(0);
|
||||
expect(result.json).toBeDefined();
|
||||
},
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user