fix(cli): align structured output guard with native flags (#777)
Signed-off-by: RudyCelekli <47457359+rudycelekli@users.noreply.github.com>
This commit is contained in:
@@ -57,6 +57,25 @@ describe("CLI output argument and sanitization boundary", () => {
|
||||
).toEqual({ ok: true });
|
||||
});
|
||||
|
||||
workspaceCliTest(
|
||||
"preserves complete JSON errors when native builtin flags follow unusual arguments",
|
||||
async ({ cli }) => {
|
||||
for (const arguments_ of [
|
||||
["providers", "--", "--json", "--token-limit", "5"],
|
||||
["providers", "--json", "--format=toon", "--token-limit", "5"],
|
||||
]) {
|
||||
const result = await cli.run({ arguments: arguments_ });
|
||||
expect(result.exitCode).toBe(1);
|
||||
expect(result.stdout).not.toContain("[truncated:");
|
||||
expect(JSON.parse(result.stdout)).toMatchObject({
|
||||
ok: false,
|
||||
error: { code: "UNSUPPORTED_OUTPUT_COMBINATION" },
|
||||
});
|
||||
}
|
||||
},
|
||||
CLI_INTEGRATION_TIMEOUT_MS,
|
||||
);
|
||||
|
||||
workspaceCliTest(
|
||||
"fails before emitting a truncated JSON document",
|
||||
async ({ cli }) => {
|
||||
|
||||
Reference in New Issue
Block a user