test: tighten openshell backend assertion · openclaw/openclaw@1c484d4
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -493,9 +493,14 @@ describe("openshell sandbox backend e2e", () => {
|
493 | 493 | } |
494 | 494 | |
495 | 495 | await bridge.writeFile({ filePath: "nested/remote-only.txt", data: "hello-remote\n" }); |
496 | | -await expect( |
497 | | -fs.readFile(path.join(workspaceDir, "nested", "remote-only.txt"), "utf8"), |
498 | | -).rejects.toMatchObject({ code: "ENOENT" }); |
| 496 | +const hostReadError = await fs |
| 497 | +.readFile(path.join(workspaceDir, "nested", "remote-only.txt"), "utf8") |
| 498 | +.then( |
| 499 | +() => undefined, |
| 500 | +(error: unknown) => error, |
| 501 | +); |
| 502 | +expect(hostReadError).toBeInstanceOf(Error); |
| 503 | +expect((hostReadError as NodeJS.ErrnoException).code).toBe("ENOENT"); |
499 | 504 | await expect(bridge.readFile({ filePath: "nested/remote-only.txt" })).resolves.toEqual( |
500 | 505 | Buffer.from("hello-remote\n"), |
501 | 506 | ); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。