test: tighten config helper object assertions

This commit is contained in:
Peter Steinberger
2026-05-09 03:11:58 +01:00
parent 06625e87df
commit 2f9a9c6b91
2 changed files with 6 additions and 2 deletions

View File

@@ -272,6 +272,10 @@ function expectCopilotProviderFromPlan(
? (JSON.parse(plan.contents) as { providers?: Record<string, unknown> })
: {};
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;
}

View File

@@ -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");
}