mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-13 03:30:45 +00:00
test: tighten compaction hook assertion
This commit is contained in:
@@ -101,7 +101,11 @@ describe("compaction hook wiring", () => {
|
||||
}) {
|
||||
expect(params.call.event).toEqual(expect.objectContaining(params.expectedEvent));
|
||||
if (params.expectedSessionKey !== undefined) {
|
||||
expect(params.call.hookCtx?.sessionKey).toBe(params.expectedSessionKey);
|
||||
expect(params.call.hookCtx).toBeDefined();
|
||||
if (!params.call.hookCtx) {
|
||||
throw new Error("Expected compaction hook context");
|
||||
}
|
||||
expect(params.call.hookCtx.sessionKey).toBe(params.expectedSessionKey);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user