chore: logger cleanup and test fixes

This commit is contained in:
Peter Steinberger committed 2025-11-25 04:05:02 +01:00
1 parent fdfb1df0de
commit d7cc94333a
5 files changed
+88 -30

No files matched your search

+28
View File
@@ -209,6 +209,34 @@ describe("config and templating", () => {
expect(result).toBe("hello world");
});
it("parses Claude JSON output even without explicit claudeOutputFormat when using claude bin", async () => {
const runSpy = vi.spyOn(index, "runCommandWithTimeout").mockResolvedValue({
stdout: '{"result":"Sure! What\'s up?"}\n',
stderr: "",
code: 0,
signal: null,
killed: false,
});
const cfg = {
inbound: {
reply: {
mode: "command" as const,
command: ["claude", "{{Body}}"],
// No claudeOutputFormat set on purpose
},
},
};
const result = await index.getReplyFromConfig(
{ Body: "hi", From: "+1", To: "+2" },
undefined,
cfg,
runSpy,
);
expect(result).toBe("Sure! What's up?");
});
});
describe("twilio interactions", () => {