test: tighten gateway compaction ids · openclaw/openclaw@0248305
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -196,7 +196,8 @@ describe("session-compaction-checkpoints", () => {
|
196 | 196 | expect(forkSpy).not.toHaveBeenCalled(); |
197 | 197 | expect(forked).not.toBeNull(); |
198 | 198 | expect(forked?.sessionFile).not.toBe(sessionFile); |
199 | | -expect(forked?.sessionId).toEqual(expect.any(String)); |
| 199 | +expect(forked?.sessionId).toBeTypeOf("string"); |
| 200 | +expect(forked?.sessionId).not.toBe(""); |
200 | 201 | } finally { |
201 | 202 | openSpy.mockRestore(); |
202 | 203 | forkSpy.mockRestore(); |
@@ -289,13 +290,15 @@ describe("session-compaction-checkpoints", () => {
|
289 | 290 | parentId: null, |
290 | 291 | message: expect.objectContaining({ content: "legacy first" }), |
291 | 292 | }); |
292 | | -expect(forkedEntries[1]?.id).toEqual(expect.any(String)); |
| 293 | +expect(forkedEntries[1]?.id).toBeTypeOf("string"); |
| 294 | +expect(forkedEntries[1]?.id).not.toBe(""); |
293 | 295 | expect(forkedEntries[2]).toMatchObject({ |
294 | 296 | type: "message", |
295 | 297 | parentId: forkedEntries[1]?.id, |
296 | 298 | message: expect.objectContaining({ content: "legacy second" }), |
297 | 299 | }); |
298 | | -expect(forkedEntries[2]?.id).toEqual(expect.any(String)); |
| 300 | +expect(forkedEntries[2]?.id).toBeTypeOf("string"); |
| 301 | +expect(forkedEntries[2]?.id).not.toBe(""); |
299 | 302 | |
300 | 303 | const messages = SessionManager.open(forked!.sessionFile, dir).buildSessionContext().messages; |
301 | 304 | expect(messages.map((message) => (message as { content?: unknown }).content)).toEqual([ |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。