test(browser): use existing outside trash path · openclaw/openclaw@dddd9cb
vincentkoc
·
2026-05-07
·
via Recent Commits to openclaw:main
File tree
extensions/browser/src/browser
| Original file line number | Diff line number | Diff line change |
|---|
@@ -115,8 +115,12 @@ describe("browser trash", () => {
|
115 | 115 | |
116 | 116 | it("refuses to trash paths outside allowed roots", async () => { |
117 | 117 | const { movePathToTrash } = await import("./trash.js"); |
| 118 | +const outsideDir = path.join(testRoot, "outside"); |
| 119 | +realMkdirSync(outsideDir, { recursive: true }); |
| 120 | +const outsidePath = path.join(outsideDir, "openclaw-demo"); |
| 121 | +realWriteFileSync(outsidePath, "outside"); |
118 | 122 | |
119 | | -await expect(movePathToTrash("/etc/openclaw-demo")).rejects.toThrow( |
| 123 | +await expect(movePathToTrash(outsidePath)).rejects.toThrow( |
120 | 124 | "Refusing to trash path outside allowed roots", |
121 | 125 | ); |
122 | 126 | }); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。