From ca2c00bd7b35d2d32f0f7370ea0c8f0462fc81b4 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 8 May 2026 15:59:55 +0100 Subject: [PATCH] test: tighten gateway helper assertions --- src/gateway/call.test.ts | 2 +- src/gateway/gateway-cli-backend.live-helpers.test.ts | 8 ++++---- src/gateway/session-utils.fs.test.ts | 4 +--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/gateway/call.test.ts b/src/gateway/call.test.ts index fab3f0b26da..e0cc2b8029c 100644 --- a/src/gateway/call.test.ts +++ b/src/gateway/call.test.ts @@ -963,7 +963,7 @@ describe("callGateway error details", () => { }); expect(eventLoopReadyState.calls).toHaveLength(1); expect(eventLoopReadyState.calls[0]?.maxWaitMs).toBe(5); - expect(lastClientOptions).not.toBeNull(); + expect(lastClientOptions?.url).toBe("ws://127.0.0.1:18789"); expect(startCalls).toBe(0); }); diff --git a/src/gateway/gateway-cli-backend.live-helpers.test.ts b/src/gateway/gateway-cli-backend.live-helpers.test.ts index 5a0eb4e88bb..3b54cbdd91b 100644 --- a/src/gateway/gateway-cli-backend.live-helpers.test.ts +++ b/src/gateway/gateway-cli-backend.live-helpers.test.ts @@ -88,10 +88,10 @@ describe("gateway cli backend live helpers", () => { token: "gateway-token", }); - expect(typeof client).toBe("object"); - expect(client).not.toBeNull(); - expect(typeof (client as { start?: unknown }).start).toBe("function"); - expect(typeof (client as { stopAndWait?: unknown }).stopAndWait).toBe("function"); + expect(client).toMatchObject({ + start: expect.any(Function), + stopAndWait: expect.any(Function), + }); expect(gatewayClientState.lastOptions).toMatchObject({ url: "ws://127.0.0.1:18789", token: "gateway-token", diff --git a/src/gateway/session-utils.fs.test.ts b/src/gateway/session-utils.fs.test.ts index 7a3b7bd9fce..792a78cd0e2 100644 --- a/src/gateway/session-utils.fs.test.ts +++ b/src/gateway/session-utils.fs.test.ts @@ -2056,9 +2056,7 @@ describe("oversized transcript line guards", () => { 512 * 1024, ); - expect(usage).not.toBeNull(); - expect(usage?.modelProvider).not.toBe("oversized-provider"); - expect(usage?.modelProvider).toBe("test-provider"); + expect(usage).toMatchObject({ modelProvider: "test-provider" }); }); test("readSessionTitleFieldsFromTranscriptAsync delegates to bounded sync reader", async () => {