test: guard http header mock calls · openclaw/openclaw@7f89b07
steipete
·
2026-05-12
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -46,8 +46,10 @@ function expectHeaderNotSet(setHeader: ReturnType<typeof vi.fn>, name: string):
|
46 | 46 | |
47 | 47 | function mockCallRecord(mock: ReturnType<typeof vi.fn>, index: number): unknown[] { |
48 | 48 | const call = mock.mock.calls[index]; |
49 | | -expect(call).toBeTruthy(); |
50 | | -return call ?? []; |
| 49 | +if (!call) { |
| 50 | +throw new Error(`Expected mock call ${index}`); |
| 51 | +} |
| 52 | +return call; |
51 | 53 | } |
52 | 54 | |
53 | 55 | describe("setDefaultSecurityHeaders", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。