test: tighten config helper object assertions · openclaw/openclaw@2f9a9c6
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -272,6 +272,10 @@ function expectCopilotProviderFromPlan(
|
272 | 272 | ? (JSON.parse(plan.contents) as { providers?: Record<string, unknown> }) |
273 | 273 | : {}; |
274 | 274 | const provider = parsed.providers?.["github-copilot"]; |
275 | | -expect(provider).toEqual(expect.any(Object)); |
| 275 | +expect(provider).not.toBeNull(); |
| 276 | +expect(typeof provider).toBe("object"); |
| 277 | +if (provider === null || typeof provider !== "object") { |
| 278 | +throw new Error("Expected GitHub Copilot provider config"); |
| 279 | +} |
276 | 280 | return provider; |
277 | 281 | } |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -656,7 +656,7 @@ describe("legacy migrate heartbeat config", () => {
|
656 | 656 | }); |
657 | 657 | |
658 | 658 | expect(res.changes).toContain("Removed empty top-level heartbeat."); |
659 | | -expect(res.config).toEqual(expect.any(Object)); |
| 659 | +expect(res.config).not.toBeNull(); |
660 | 660 | if (res.config === null) { |
661 | 661 | throw new Error("Expected migrated config"); |
662 | 662 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。