test: guard model test record assertions · openclaw/openclaw@ff5bbac
steipete
·
2026-05-12
·
via Recent Commits to openclaw:main
File tree
src/agents/pi-embedded-runner
| Original file line number | Diff line number | Diff line change |
|---|
@@ -253,7 +253,9 @@ function expectResolvedModel(result: ResolveModelForTestResult) {
|
253 | 253 | } |
254 | 254 | |
255 | 255 | function expectRecordFields(record: unknown, expected: Record<string, unknown>) { |
256 | | -expect(record).toBeDefined(); |
| 256 | +if (!record || typeof record !== "object") { |
| 257 | +throw new Error("Expected record"); |
| 258 | +} |
257 | 259 | const actual = record as Record<string, unknown>; |
258 | 260 | for (const [key, value] of Object.entries(expected)) { |
259 | 261 | expect(actual[key]).toEqual(value); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。