test(e2e): use tracked ClawHub temp fixture · openclaw/openclaw@1cbcc3e
vincentkoc
·
2026-06-20
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -14,6 +14,7 @@ import { tmpdir } from "node:os";
|
14 | 14 | import path from "node:path"; |
15 | 15 | import { describe, expect, it } from "vitest"; |
16 | 16 | import { createBoundedChildOutput } from "../helpers/bounded-child-output.js"; |
| 17 | +import { cleanupTempDirs, makeTempDir } from "../helpers/temp-dir.js"; |
17 | 18 | |
18 | 19 | const ASSERTIONS_SCRIPT = "scripts/e2e/lib/plugins/assertions.mjs"; |
19 | 20 | |
@@ -845,7 +846,8 @@ test -d "$OPENCLAW_PLUGINS_TMP_DIR"
|
845 | 846 | }); |
846 | 847 | |
847 | 848 | it("rejects ClawHub install paths that resolve outside the managed extensions root", () => { |
848 | | -const root = mkdtempSync(path.join(tmpdir(), "openclaw-plugins-clawhub-path-")); |
| 849 | +const tempDirs: string[] = []; |
| 850 | +const root = makeTempDir(tempDirs, "openclaw-plugins-clawhub-path-"); |
849 | 851 | const home = path.join(root, "home"); |
850 | 852 | const scratchRoot = path.join(root, "scratch"); |
851 | 853 | const extensionsRoot = path.join(home, ".openclaw", "extensions"); |
@@ -888,7 +890,7 @@ test -d "$OPENCLAW_PLUGINS_TMP_DIR"
|
888 | 890 | expect(result.status).not.toBe(0); |
889 | 891 | expect(result.stderr).toContain("ClawHub install path resolved outside"); |
890 | 892 | } finally { |
891 | | -rmSync(root, { force: true, recursive: true }); |
| 893 | +cleanupTempDirs(tempDirs); |
892 | 894 | } |
893 | 895 | }); |
894 | 896 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。