From 29f85ca246d7f9d28d5ddd8bbdee5ae53572665a Mon Sep 17 00:00:00 2001 From: Shakker Date: Mon, 11 May 2026 13:41:08 +0100 Subject: [PATCH] test: pin gateway client logs --- src/gateway/client.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gateway/client.test.ts b/src/gateway/client.test.ts index 8240f9193a8..d54fe00fd03 100644 --- a/src/gateway/client.test.ts +++ b/src/gateway/client.test.ts @@ -513,10 +513,10 @@ describe("GatewayClient request errors", () => { expect(onConnectError).not.toHaveBeenCalled(); expect(onClose).not.toHaveBeenCalled(); expect(ws.lastClose).toEqual({ code: 1013, reason: "gateway starting" }); - expect(logDebugMock).toHaveBeenCalledWith(expect.stringContaining("gateway connect failed:")); - expect(logErrorMock).not.toHaveBeenCalledWith( - expect.stringContaining("gateway connect failed:"), - ); + expect(logDebugMock.mock.calls).toEqual([ + ["gateway connect failed: GatewayClientRequestError: gateway starting; retry shortly"], + ]); + expect(logErrorMock.mock.calls).toEqual([]); expect(wsInstances).toHaveLength(1); await vi.advanceTimersByTimeAsync(249); @@ -568,7 +568,7 @@ describe("GatewayClient close handling", () => { expect(getLatestWs().emitClose(1008, "unauthorized: device token mismatch")).toBeUndefined(); expect(logDebugMock).toHaveBeenCalledWith( - expect.stringContaining("failed clearing stale device-auth token"), + "failed clearing stale device-auth token for device dev-2: Error: disk unavailable", ); expect(onClose).toHaveBeenCalledWith(1008, "unauthorized: device token mismatch"); client.stop();