From 9162d547a54aa356ae4f100e70ea41f856d9022e Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 9 May 2026 06:50:13 +0100 Subject: [PATCH] test: tighten voice tailscale spawn assertions --- extensions/voice-call/src/webhook/tailscale.test.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/extensions/voice-call/src/webhook/tailscale.test.ts b/extensions/voice-call/src/webhook/tailscale.test.ts index d3abfa3632f..aedaf29f24d 100644 --- a/extensions/voice-call/src/webhook/tailscale.test.ts +++ b/extensions/voice-call/src/webhook/tailscale.test.ts @@ -5,6 +5,8 @@ const { spawnMock } = vi.hoisted(() => ({ spawnMock: vi.fn(), })); +const tailscaleSpawnOptions = { stdio: ["ignore", "pipe", "pipe"] } as const; + vi.mock("node:child_process", async () => { const { mockNodeBuiltinModule } = await import("openclaw/plugin-sdk/test-node-mocks"); return mockNodeBuiltinModule( @@ -126,19 +128,19 @@ describe("voice-call tailscale helpers", () => { 1, "tailscale", ["status", "--json"], - expect.objectContaining({ stdio: ["ignore", "pipe", "pipe"] }), + tailscaleSpawnOptions, ); expect(spawnMock).toHaveBeenNthCalledWith( 2, "tailscale", ["serve", "--bg", "--yes", "--set-path", "/voice", "http://127.0.0.1:8787/webhook"], - expect.any(Object), + tailscaleSpawnOptions, ); expect(spawnMock).toHaveBeenNthCalledWith( 3, "tailscale", ["serve", "off", "/voice"], - expect.any(Object), + tailscaleSpawnOptions, ); }); @@ -202,13 +204,13 @@ describe("voice-call tailscale helpers", () => { 2, "tailscale", ["funnel", "--bg", "--yes", "--set-path", "/voice", "http://127.0.0.1:8787/webhook"], - expect.any(Object), + tailscaleSpawnOptions, ); expect(spawnMock).toHaveBeenNthCalledWith( 3, "tailscale", ["serve", "off", "/voice"], - expect.any(Object), + tailscaleSpawnOptions, ); }); });