test: tighten apply patch traversal assertion · openclaw/openclaw@26816bf
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -218,7 +218,11 @@ describe("Agent-specific tool filtering", () => {
|
218 | 218 | await expect(applyPatchTool.execute("tc1", { input: patch })).rejects.toThrow( |
219 | 219 | /Path escapes sandbox root/, |
220 | 220 | ); |
221 | | -await expect(fs.readFile(escapedPath, "utf8")).rejects.toMatchObject({ code: "ENOENT" }); |
| 221 | +const readError = await fs.readFile(escapedPath, "utf8").then( |
| 222 | +() => undefined, |
| 223 | +(err: NodeJS.ErrnoException) => err, |
| 224 | +); |
| 225 | +expect(readError?.code).toBe("ENOENT"); |
222 | 226 | }); |
223 | 227 | }); |
224 | 228 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。