From 2066e8b271a7f98f06356d416062bb945f94e6a6 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 9 May 2026 14:03:54 +0100 Subject: [PATCH] test: tighten bundle lsp spawn assertion --- src/agents/pi-bundle-lsp-runtime.test.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/agents/pi-bundle-lsp-runtime.test.ts b/src/agents/pi-bundle-lsp-runtime.test.ts index 809ae1145f6..7d67bfb34bd 100644 --- a/src/agents/pi-bundle-lsp-runtime.test.ts +++ b/src/agents/pi-bundle-lsp-runtime.test.ts @@ -105,15 +105,13 @@ describe("bundle LSP runtime", () => { const runtime = await createBundleLspToolRuntime({ workspaceDir: "/tmp/workspace" }); - expect(spawnMock).toHaveBeenCalledWith( - "typescript-language-server", - ["--stdio"], - expect.objectContaining({ - detached: process.platform !== "win32", - stdio: ["pipe", "pipe", "pipe"], - windowsHide: process.platform === "win32", - }), - ); + expect(spawnMock).toHaveBeenCalledTimes(1); + const [command, args, options] = spawnMock.mock.calls[0] ?? []; + expect(command).toBe("typescript-language-server"); + expect(args).toEqual(["--stdio"]); + expect(options?.detached).toBe(process.platform !== "win32"); + expect(options?.stdio).toEqual(["pipe", "pipe", "pipe"]); + expect(options?.windowsHide).toBe(process.platform === "win32"); expect(runtime.tools.map((tool) => tool.name)).toContain("lsp_hover_typescript"); await runtime.dispose();