test: tighten e2e absence assertions

This commit is contained in:
Peter Steinberger
2026-05-09 02:02:28 +01:00
parent 89a435b1e8
commit 30e870e424
2 changed files with 5 additions and 3 deletions

View File

@@ -495,7 +495,7 @@ describe("openshell sandbox backend e2e", () => {
await bridge.writeFile({ filePath: "nested/remote-only.txt", data: "hello-remote\n" });
await expect(
fs.readFile(path.join(workspaceDir, "nested", "remote-only.txt"), "utf8"),
).rejects.toThrow();
).rejects.toMatchObject({ code: "ENOENT" });
await expect(bridge.readFile({ filePath: "nested/remote-only.txt" })).resolves.toEqual(
Buffer.from("hello-remote\n"),
);

View File

@@ -462,7 +462,9 @@ describe("scripts/docker/setup.sh", () => {
expect(result.stderr).toContain("Sandbox requires Docker CLI");
const log = await readDockerLog(activeSandbox);
expect(log).toContain("config set agents.defaults.sandbox.mode off");
await expect(stat(join(activeSandbox.rootDir, "docker-compose.sandbox.yml"))).rejects.toThrow();
await expect(
stat(join(activeSandbox.rootDir, "docker-compose.sandbox.yml")),
).rejects.toMatchObject({ code: "ENOENT" });
});
it("skips sandbox gateway restart when sandbox config writes fail", async () => {
@@ -499,7 +501,7 @@ describe("scripts/docker/setup.sh", () => {
expect(forceRecreateLine).not.toContain("docker-compose.sandbox.yml");
await expect(
stat(join(activeSandbox.rootDir, "docker-compose.sandbox.yml")),
).rejects.toThrow();
).rejects.toMatchObject({ code: "ENOENT" });
});
});