From 2f9a9c6b911c589ea91f593e018533d73eef9614 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 9 May 2026 03:11:58 +0100 Subject: [PATCH] test: tighten config helper object assertions --- ...fig.uses-first-github-copilot-profile-env-tokens.test.ts | 6 +++++- src/commands/doctor/shared/legacy-config-migrate.test.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/agents/models-config.uses-first-github-copilot-profile-env-tokens.test.ts b/src/agents/models-config.uses-first-github-copilot-profile-env-tokens.test.ts index 17ce8e2063e..23297695f78 100644 --- a/src/agents/models-config.uses-first-github-copilot-profile-env-tokens.test.ts +++ b/src/agents/models-config.uses-first-github-copilot-profile-env-tokens.test.ts @@ -272,6 +272,10 @@ function expectCopilotProviderFromPlan( ? (JSON.parse(plan.contents) as { providers?: Record }) : {}; const provider = parsed.providers?.["github-copilot"]; - expect(provider).toEqual(expect.any(Object)); + expect(provider).not.toBeNull(); + expect(typeof provider).toBe("object"); + if (provider === null || typeof provider !== "object") { + throw new Error("Expected GitHub Copilot provider config"); + } return provider; } diff --git a/src/commands/doctor/shared/legacy-config-migrate.test.ts b/src/commands/doctor/shared/legacy-config-migrate.test.ts index 985e7558e23..6cbda719a7a 100644 --- a/src/commands/doctor/shared/legacy-config-migrate.test.ts +++ b/src/commands/doctor/shared/legacy-config-migrate.test.ts @@ -656,7 +656,7 @@ describe("legacy migrate heartbeat config", () => { }); expect(res.changes).toContain("Removed empty top-level heartbeat."); - expect(res.config).toEqual(expect.any(Object)); + expect(res.config).not.toBeNull(); if (res.config === null) { throw new Error("Expected migrated config"); }