Ignore coverage output and document Claude text mode

This commit is contained in:
Peter Steinberger
2025-11-25 01:38:43 +01:00
parent b4e5f20cd7
commit d0c9bff4ca
26 changed files with 39 additions and 11127 deletions

View File

@@ -143,6 +143,42 @@ describe("config and templating", () => {
const argvSecond = runSpy.mock.calls[1][0];
expect(argvSecond[2]).toBe("--resume");
});
it("injects Claude output format + print flag when configured", async () => {
const runSpy = vi.spyOn(index, "runCommandWithTimeout").mockResolvedValue({
stdout: "ok",
stderr: "",
code: 0,
signal: null,
killed: false,
});
const cfg = {
inbound: {
reply: {
mode: "command" as const,
command: ["claude", "{{Body}}"],
claudeOutputFormat: "text" as const,
},
},
};
await index.getReplyFromConfig(
{ Body: "hi", From: "+1555", To: "+1666" },
undefined,
cfg,
runSpy,
);
const argv = runSpy.mock.calls[0][0];
expect(argv[0]).toBe("claude");
expect(argv.at(-1)).toBe("hi");
expect(argv.includes("-p") || argv.includes("--print")).toBe(true);
const outputIdx = argv.findIndex(
(part) => part === "--output-format" || part.startsWith("--output-format="),
);
expect(outputIdx).toBeGreaterThan(-1);
expect(argv[outputIdx + 1]).toBe("text");
});
});
describe("twilio interactions", () => {