test: tighten session memory missing path assertion · openclaw/openclaw@c463521
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
File tree
src/hooks/bundled/session-memory
| Original file line number | Diff line number | Diff line change |
|---|
@@ -194,7 +194,13 @@ function expectMemoryConversation(params: {
|
194 | 194 | } |
195 | 195 | |
196 | 196 | async function expectPathMissing(targetPath: string): Promise<void> { |
197 | | -await expect(fs.access(targetPath)).rejects.toMatchObject({ code: "ENOENT" }); |
| 197 | +try { |
| 198 | +await fs.access(targetPath); |
| 199 | +} catch (error) { |
| 200 | +expect((error as NodeJS.ErrnoException).code).toBe("ENOENT"); |
| 201 | +return; |
| 202 | +} |
| 203 | +throw new Error(`expected path to be missing: ${targetPath}`); |
198 | 204 | } |
199 | 205 | |
200 | 206 | describe("session-memory hook", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。