diff --git a/src/gateway/gateway-cli-backend.live.test.ts b/src/gateway/gateway-cli-backend.live.test.ts index af7b91a8d14a..59accc8fdcc1 100644 --- a/src/gateway/gateway-cli-backend.live.test.ts +++ b/src/gateway/gateway-cli-backend.live.test.ts @@ -461,11 +461,13 @@ describeLive("gateway live (cli backend)", () => { } else { expect(text).toContain(`CLI-BACKEND-${nonce}`); } - expect( + const injectedFileNames = resultWithMeta.meta?.systemPromptReport?.injectedWorkspaceFiles?.map( (entry) => entry.name, - ) ?? [], - ).toEqual(expect.arrayContaining(bootstrapWorkspace?.expectedInjectedFiles ?? [])); + ) ?? []; + for (const expectedFile of bootstrapWorkspace?.expectedInjectedFiles ?? []) { + expect(injectedFileNames).toContain(expectedFile); + } } if (modelSwitchTarget) { diff --git a/src/gateway/gateway-models.profiles.live.test.ts b/src/gateway/gateway-models.profiles.live.test.ts index 6a1d79ad4259..fb6e74e5779e 100644 --- a/src/gateway/gateway-models.profiles.live.test.ts +++ b/src/gateway/gateway-models.profiles.live.test.ts @@ -1358,10 +1358,8 @@ describe("sanitizeAuthProfileStoreForLiveGateway", () => { try { const sanitized = sanitizeAuthProfileStoreForLiveGateway(store); expect(sanitized.profiles.openaiProfile).toBeUndefined(); - expect(sanitized.profiles.codexProfile).toMatchObject({ - type: "oauth", - provider: "openai-codex", - }); + expect(sanitized.profiles.codexProfile?.type).toBe("oauth"); + expect(sanitized.profiles.codexProfile?.provider).toBe("openai-codex"); expect(sanitized.order).toEqual({ "openai-codex": ["codexProfile"] }); expect(sanitized.lastGood).toEqual({ "openai-codex": "codexProfile" }); expect(sanitized.usageStats).toEqual({ codexProfile: { lastUsed: 2 } }); diff --git a/src/gateway/gateway-trajectory-export.live.test.ts b/src/gateway/gateway-trajectory-export.live.test.ts index 062bc8ab7062..21f8e51fb90e 100644 --- a/src/gateway/gateway-trajectory-export.live.test.ts +++ b/src/gateway/gateway-trajectory-export.live.test.ts @@ -152,10 +152,8 @@ async function approveTrajectoryExport(client: GatewayClient): Promise { const approval = approvals.find((entry) => entry.request?.command?.includes("sessions export-trajectory"), ); - expect(approval).toMatchObject({ - id: expect.any(String), - request: { command: expect.stringContaining("sessions export-trajectory") }, - }); + expect(typeof approval?.id).toBe("string"); + expect(approval?.request?.command).toContain("sessions export-trajectory"); if (!approval?.id) { throw new Error("expected trajectory export approval id"); } @@ -285,17 +283,18 @@ describeLive("gateway live trajectory export", () => { if (finalText) { expect(finalText).toContain("Approve once"); } - expect(await listDirectoryNames(bundleDir)).toEqual( - expect.arrayContaining([ - "artifacts.json", - "events.jsonl", - "manifest.json", - "metadata.json", - "prompts.json", - "session.jsonl", - "tools.json", - ]), - ); + const bundleNames = await listDirectoryNames(bundleDir); + for (const expectedName of [ + "artifacts.json", + "events.jsonl", + "manifest.json", + "metadata.json", + "prompts.json", + "session.jsonl", + "tools.json", + ]) { + expect(bundleNames).toContain(expectedName); + } expect(beforeExport.has("bundle")).toBe(false); const manifest = JSON.parse( diff --git a/src/gateway/server-methods/plugin-approval.test.ts b/src/gateway/server-methods/plugin-approval.test.ts index 1a30671f6f9d..31241ae279c8 100644 --- a/src/gateway/server-methods/plugin-approval.test.ts +++ b/src/gateway/server-methods/plugin-approval.test.ts @@ -107,9 +107,7 @@ function expectPluginApprovalId(value: unknown, label: string): string { expect(uuid).toHaveLength(36); expect(uuid.split("-").map((part) => part.length)).toEqual([8, 4, 4, 4, 12]); expect( - uuid - .split("-") - .every((part) => part.length > 0 && [...part].every((char) => /[0-9a-f]/.test(char))), + uuid.split("-").every((part) => /^[0-9a-f]+$/.test(part)), label, ).toBe(true); return value;