mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-13 23:56:07 +00:00
test: tighten openshell backend assertion
This commit is contained in:
@@ -493,9 +493,14 @@ 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.toMatchObject({ code: "ENOENT" });
|
||||
const hostReadError = await fs
|
||||
.readFile(path.join(workspaceDir, "nested", "remote-only.txt"), "utf8")
|
||||
.then(
|
||||
() => undefined,
|
||||
(error: unknown) => error,
|
||||
);
|
||||
expect(hostReadError).toBeInstanceOf(Error);
|
||||
expect((hostReadError as NodeJS.ErrnoException).code).toBe("ENOENT");
|
||||
await expect(bridge.readFile({ filePath: "nested/remote-only.txt" })).resolves.toEqual(
|
||||
Buffer.from("hello-remote\n"),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user