test: tighten compaction hook assertion · openclaw/openclaw@f49beec
shakkernerd
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -101,7 +101,11 @@ describe("compaction hook wiring", () => {
|
101 | 101 | }) { |
102 | 102 | expect(params.call.event).toEqual(expect.objectContaining(params.expectedEvent)); |
103 | 103 | if (params.expectedSessionKey !== undefined) { |
104 | | -expect(params.call.hookCtx?.sessionKey).toBe(params.expectedSessionKey); |
| 104 | +expect(params.call.hookCtx).toBeDefined(); |
| 105 | +if (!params.call.hookCtx) { |
| 106 | +throw new Error("Expected compaction hook context"); |
| 107 | +} |
| 108 | +expect(params.call.hookCtx.sessionKey).toBe(params.expectedSessionKey); |
105 | 109 | } |
106 | 110 | } |
107 | 111 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。