Skip to content

Commit b1bb775

Browse files
committed
test(agents): accept canonical sandbox escape error
1 parent 46d49f8 commit b1bb775

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎src/agents/sandbox-paths.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,18 @@ describe("assertSandboxPath", () => {
135135
const escapedRead = `${root}/sub/up/../outside/secret.txt`;
136136
await expect(fs.readFile(escapedRead, "utf8")).resolves.toBe("outside");
137137
await expect(assertSandboxPath({ filePath: escapedRead, cwd: root, root })).rejects.toThrow(
138-
/escapes sandbox root/i,
138+
/(?:resolves outside|escapes) sandbox root/i,
139139
);
140140
await expect(
141141
assertSandboxPath({
142142
filePath: `${root}/sub/up/../outside/new.txt`,
143143
cwd: root,
144144
root,
145145
}),
146-
).rejects.toThrow(/escapes sandbox root/i);
146+
).rejects.toThrow(/(?:resolves outside|escapes) sandbox root/i);
147147
await expect(
148148
assertSandboxPath({ filePath: `${root}/sub/up/../..`, cwd: root, root }),
149-
).rejects.toThrow(/escapes sandbox root/i);
149+
).rejects.toThrow(/(?:resolves outside|escapes) sandbox root/i);
150150

151151
await fs.mkdir(path.join(root, "a"));
152152
await fs.mkdir(path.join(root, "b"));

0 commit comments

Comments
 (0)