mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-14 12:40:43 +00:00
test: tighten apply patch traversal assertion
This commit is contained in:
@@ -218,7 +218,11 @@ describe("Agent-specific tool filtering", () => {
|
||||
await expect(applyPatchTool.execute("tc1", { input: patch })).rejects.toThrow(
|
||||
/Path escapes sandbox root/,
|
||||
);
|
||||
await expect(fs.readFile(escapedPath, "utf8")).rejects.toMatchObject({ code: "ENOENT" });
|
||||
const readError = await fs.readFile(escapedPath, "utf8").then(
|
||||
() => undefined,
|
||||
(err: NodeJS.ErrnoException) => err,
|
||||
);
|
||||
expect(readError?.code).toBe("ENOENT");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user