diff --git a/src/plugins/voice-call.plugin.test.ts b/src/plugins/voice-call.plugin.test.ts index 8ff3642a3a9..8e3d02de8f6 100644 --- a/src/plugins/voice-call.plugin.test.ts +++ b/src/plugins/voice-call.plugin.test.ts @@ -53,7 +53,6 @@ function captureStdout() { restore: () => writeSpy.mockRestore(), }; } - function setup(config: Record): Registered { const methods = new Map(); 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(); + } }); });