test: fix voice-call cli stdout assertions

This commit is contained in:
Peter Steinberger
2026-03-27 07:35:19 +00:00
parent 53304ff704
commit e1235ca7b4

View File

@@ -53,7 +53,6 @@ function captureStdout() {
restore: () => writeSpy.mockRestore(),
};
}
function setup(config: Record<string, unknown>): Registered {
const methods = new Map<string, unknown>();
const tools: unknown[] = [];
@@ -212,6 +211,7 @@ describe("voice-call plugin", () => {
from: "user",
});
const printed = stdout.output();
const printed = stdout.output();
expect(printed).toContain('"recordsScanned": 2');
expect(printed).toContain('"p50Ms": 100');
@@ -227,10 +227,13 @@ describe("voice-call plugin", () => {
const stdout = captureStdout();
await registerVoiceCallCli(program);
await program.parseAsync(["voicecall", "start", "--to", "+1", "--message", "Hello"], {
from: "user",
});
expect(stdout.output()).toContain('"callId": "call-1"');
stdout.restore();
try {
await program.parseAsync(["voicecall", "start", "--to", "+1", "--message", "Hello"], {
from: "user",
});
expect(stdout.output()).toContain('"callId": "call-1"');
} finally {
stdout.restore();
}
});
});