mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 20:14:30 +00:00
perf(test): speed up control-ui-assets suite
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import fs from "node:fs/promises";
|
import fs from "node:fs/promises";
|
||||||
import os from "node:os";
|
import os from "node:os";
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import { describe, expect, it } from "vitest";
|
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
||||||
import {
|
import {
|
||||||
resolveControlUiDistIndexHealth,
|
resolveControlUiDistIndexHealth,
|
||||||
resolveControlUiDistIndexPath,
|
resolveControlUiDistIndexPath,
|
||||||
@@ -31,9 +31,27 @@ async function canonicalPath(p: string): Promise<string> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
describe("control UI assets helpers", () => {
|
describe("control UI assets helpers", () => {
|
||||||
|
let fixtureRoot = "";
|
||||||
|
let caseId = 0;
|
||||||
|
|
||||||
|
async function withTempDir<T>(fn: (tmp: string) => Promise<T>): Promise<T> {
|
||||||
|
const tmp = path.join(fixtureRoot, `case-${caseId++}`);
|
||||||
|
await fs.mkdir(tmp, { recursive: true });
|
||||||
|
return await fn(tmp);
|
||||||
|
}
|
||||||
|
|
||||||
|
beforeAll(async () => {
|
||||||
|
fixtureRoot = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-ui-"));
|
||||||
|
});
|
||||||
|
|
||||||
|
afterAll(async () => {
|
||||||
|
if (fixtureRoot) {
|
||||||
|
await fs.rm(fixtureRoot, { recursive: true, force: true });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
it("resolves repo root from src argv1", async () => {
|
it("resolves repo root from src argv1", async () => {
|
||||||
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-ui-"));
|
await withTempDir(async (tmp) => {
|
||||||
try {
|
|
||||||
await fs.mkdir(path.join(tmp, "ui"), { recursive: true });
|
await fs.mkdir(path.join(tmp, "ui"), { recursive: true });
|
||||||
await fs.writeFile(path.join(tmp, "ui", "vite.config.ts"), "export {};\n");
|
await fs.writeFile(path.join(tmp, "ui", "vite.config.ts"), "export {};\n");
|
||||||
await fs.writeFile(path.join(tmp, "package.json"), "{}\n");
|
await fs.writeFile(path.join(tmp, "package.json"), "{}\n");
|
||||||
@@ -41,14 +59,11 @@ describe("control UI assets helpers", () => {
|
|||||||
await fs.writeFile(path.join(tmp, "src", "index.ts"), "export {};\n");
|
await fs.writeFile(path.join(tmp, "src", "index.ts"), "export {};\n");
|
||||||
|
|
||||||
expect(resolveControlUiRepoRoot(path.join(tmp, "src", "index.ts"))).toBe(tmp);
|
expect(resolveControlUiRepoRoot(path.join(tmp, "src", "index.ts"))).toBe(tmp);
|
||||||
} finally {
|
});
|
||||||
await fs.rm(tmp, { recursive: true, force: true });
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("resolves repo root from dist argv1", async () => {
|
it("resolves repo root from dist argv1", async () => {
|
||||||
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-ui-"));
|
await withTempDir(async (tmp) => {
|
||||||
try {
|
|
||||||
await fs.mkdir(path.join(tmp, "ui"), { recursive: true });
|
await fs.mkdir(path.join(tmp, "ui"), { recursive: true });
|
||||||
await fs.writeFile(path.join(tmp, "ui", "vite.config.ts"), "export {};\n");
|
await fs.writeFile(path.join(tmp, "ui", "vite.config.ts"), "export {};\n");
|
||||||
await fs.writeFile(path.join(tmp, "package.json"), "{}\n");
|
await fs.writeFile(path.join(tmp, "package.json"), "{}\n");
|
||||||
@@ -56,9 +71,7 @@ describe("control UI assets helpers", () => {
|
|||||||
await fs.writeFile(path.join(tmp, "dist", "index.js"), "export {};\n");
|
await fs.writeFile(path.join(tmp, "dist", "index.js"), "export {};\n");
|
||||||
|
|
||||||
expect(resolveControlUiRepoRoot(path.join(tmp, "dist", "index.js"))).toBe(tmp);
|
expect(resolveControlUiRepoRoot(path.join(tmp, "dist", "index.js"))).toBe(tmp);
|
||||||
} finally {
|
});
|
||||||
await fs.rm(tmp, { recursive: true, force: true });
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("resolves dist control-ui index path for dist argv1", async () => {
|
it("resolves dist control-ui index path for dist argv1", async () => {
|
||||||
@@ -70,8 +83,7 @@ describe("control UI assets helpers", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("resolves control-ui root for dist bundle argv1", async () => {
|
it("resolves control-ui root for dist bundle argv1", async () => {
|
||||||
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-ui-"));
|
await withTempDir(async (tmp) => {
|
||||||
try {
|
|
||||||
await fs.mkdir(path.join(tmp, "dist", "control-ui"), { recursive: true });
|
await fs.mkdir(path.join(tmp, "dist", "control-ui"), { recursive: true });
|
||||||
await fs.writeFile(path.join(tmp, "dist", "bundle.js"), "export {};\n");
|
await fs.writeFile(path.join(tmp, "dist", "bundle.js"), "export {};\n");
|
||||||
await fs.writeFile(path.join(tmp, "dist", "control-ui", "index.html"), "<html></html>\n");
|
await fs.writeFile(path.join(tmp, "dist", "control-ui", "index.html"), "<html></html>\n");
|
||||||
@@ -79,14 +91,11 @@ describe("control UI assets helpers", () => {
|
|||||||
expect(resolveControlUiRootSync({ argv1: path.join(tmp, "dist", "bundle.js") })).toBe(
|
expect(resolveControlUiRootSync({ argv1: path.join(tmp, "dist", "bundle.js") })).toBe(
|
||||||
path.join(tmp, "dist", "control-ui"),
|
path.join(tmp, "dist", "control-ui"),
|
||||||
);
|
);
|
||||||
} finally {
|
});
|
||||||
await fs.rm(tmp, { recursive: true, force: true });
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("resolves control-ui root for dist/gateway bundle argv1", async () => {
|
it("resolves control-ui root for dist/gateway bundle argv1", async () => {
|
||||||
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-ui-"));
|
await withTempDir(async (tmp) => {
|
||||||
try {
|
|
||||||
await fs.writeFile(path.join(tmp, "package.json"), JSON.stringify({ name: "openclaw" }));
|
await fs.writeFile(path.join(tmp, "package.json"), JSON.stringify({ name: "openclaw" }));
|
||||||
await fs.mkdir(path.join(tmp, "dist", "gateway"), { recursive: true });
|
await fs.mkdir(path.join(tmp, "dist", "gateway"), { recursive: true });
|
||||||
await fs.mkdir(path.join(tmp, "dist", "control-ui"), { recursive: true });
|
await fs.mkdir(path.join(tmp, "dist", "control-ui"), { recursive: true });
|
||||||
@@ -96,14 +105,11 @@ describe("control UI assets helpers", () => {
|
|||||||
expect(
|
expect(
|
||||||
resolveControlUiRootSync({ argv1: path.join(tmp, "dist", "gateway", "control-ui.js") }),
|
resolveControlUiRootSync({ argv1: path.join(tmp, "dist", "gateway", "control-ui.js") }),
|
||||||
).toBe(path.join(tmp, "dist", "control-ui"));
|
).toBe(path.join(tmp, "dist", "control-ui"));
|
||||||
} finally {
|
});
|
||||||
await fs.rm(tmp, { recursive: true, force: true });
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("resolves control-ui root from override directory or index.html", async () => {
|
it("resolves control-ui root from override directory or index.html", async () => {
|
||||||
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-ui-"));
|
await withTempDir(async (tmp) => {
|
||||||
try {
|
|
||||||
const uiDir = path.join(tmp, "dist", "control-ui");
|
const uiDir = path.join(tmp, "dist", "control-ui");
|
||||||
await fs.mkdir(uiDir, { recursive: true });
|
await fs.mkdir(uiDir, { recursive: true });
|
||||||
await fs.writeFile(path.join(uiDir, "index.html"), "<html></html>\n");
|
await fs.writeFile(path.join(uiDir, "index.html"), "<html></html>\n");
|
||||||
@@ -111,14 +117,11 @@ describe("control UI assets helpers", () => {
|
|||||||
expect(resolveControlUiRootOverrideSync(uiDir)).toBe(uiDir);
|
expect(resolveControlUiRootOverrideSync(uiDir)).toBe(uiDir);
|
||||||
expect(resolveControlUiRootOverrideSync(path.join(uiDir, "index.html"))).toBe(uiDir);
|
expect(resolveControlUiRootOverrideSync(path.join(uiDir, "index.html"))).toBe(uiDir);
|
||||||
expect(resolveControlUiRootOverrideSync(path.join(uiDir, "missing.html"))).toBeNull();
|
expect(resolveControlUiRootOverrideSync(path.join(uiDir, "missing.html"))).toBeNull();
|
||||||
} finally {
|
});
|
||||||
await fs.rm(tmp, { recursive: true, force: true });
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("resolves dist control-ui index path from package root argv1", async () => {
|
it("resolves dist control-ui index path from package root argv1", async () => {
|
||||||
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-ui-"));
|
await withTempDir(async (tmp) => {
|
||||||
try {
|
|
||||||
await fs.writeFile(path.join(tmp, "package.json"), JSON.stringify({ name: "openclaw" }));
|
await fs.writeFile(path.join(tmp, "package.json"), JSON.stringify({ name: "openclaw" }));
|
||||||
await fs.writeFile(path.join(tmp, "openclaw.mjs"), "export {};\n");
|
await fs.writeFile(path.join(tmp, "openclaw.mjs"), "export {};\n");
|
||||||
await fs.mkdir(path.join(tmp, "dist", "control-ui"), { recursive: true });
|
await fs.mkdir(path.join(tmp, "dist", "control-ui"), { recursive: true });
|
||||||
@@ -127,14 +130,11 @@ describe("control UI assets helpers", () => {
|
|||||||
expect(await resolveControlUiDistIndexPath(path.join(tmp, "openclaw.mjs"))).toBe(
|
expect(await resolveControlUiDistIndexPath(path.join(tmp, "openclaw.mjs"))).toBe(
|
||||||
path.join(tmp, "dist", "control-ui", "index.html"),
|
path.join(tmp, "dist", "control-ui", "index.html"),
|
||||||
);
|
);
|
||||||
} finally {
|
});
|
||||||
await fs.rm(tmp, { recursive: true, force: true });
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("resolves control-ui root for package entrypoint argv1", async () => {
|
it("resolves control-ui root for package entrypoint argv1", async () => {
|
||||||
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-ui-"));
|
await withTempDir(async (tmp) => {
|
||||||
try {
|
|
||||||
await fs.writeFile(path.join(tmp, "package.json"), JSON.stringify({ name: "openclaw" }));
|
await fs.writeFile(path.join(tmp, "package.json"), JSON.stringify({ name: "openclaw" }));
|
||||||
await fs.writeFile(path.join(tmp, "openclaw.mjs"), "export {};\n");
|
await fs.writeFile(path.join(tmp, "openclaw.mjs"), "export {};\n");
|
||||||
await fs.mkdir(path.join(tmp, "dist", "control-ui"), { recursive: true });
|
await fs.mkdir(path.join(tmp, "dist", "control-ui"), { recursive: true });
|
||||||
@@ -143,14 +143,11 @@ describe("control UI assets helpers", () => {
|
|||||||
expect(resolveControlUiRootSync({ argv1: path.join(tmp, "openclaw.mjs") })).toBe(
|
expect(resolveControlUiRootSync({ argv1: path.join(tmp, "openclaw.mjs") })).toBe(
|
||||||
path.join(tmp, "dist", "control-ui"),
|
path.join(tmp, "dist", "control-ui"),
|
||||||
);
|
);
|
||||||
} finally {
|
});
|
||||||
await fs.rm(tmp, { recursive: true, force: true });
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("resolves dist control-ui index path from .bin argv1", async () => {
|
it("resolves dist control-ui index path from .bin argv1", async () => {
|
||||||
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-ui-"));
|
await withTempDir(async (tmp) => {
|
||||||
try {
|
|
||||||
const binDir = path.join(tmp, "node_modules", ".bin");
|
const binDir = path.join(tmp, "node_modules", ".bin");
|
||||||
const pkgRoot = path.join(tmp, "node_modules", "openclaw");
|
const pkgRoot = path.join(tmp, "node_modules", "openclaw");
|
||||||
await fs.mkdir(binDir, { recursive: true });
|
await fs.mkdir(binDir, { recursive: true });
|
||||||
@@ -162,14 +159,11 @@ describe("control UI assets helpers", () => {
|
|||||||
expect(await resolveControlUiDistIndexPath(path.join(binDir, "openclaw"))).toBe(
|
expect(await resolveControlUiDistIndexPath(path.join(binDir, "openclaw"))).toBe(
|
||||||
path.join(pkgRoot, "dist", "control-ui", "index.html"),
|
path.join(pkgRoot, "dist", "control-ui", "index.html"),
|
||||||
);
|
);
|
||||||
} finally {
|
});
|
||||||
await fs.rm(tmp, { recursive: true, force: true });
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("resolves via fallback when package root resolution fails but package name matches", async () => {
|
it("resolves via fallback when package root resolution fails but package name matches", async () => {
|
||||||
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-ui-"));
|
await withTempDir(async (tmp) => {
|
||||||
try {
|
|
||||||
// Package named "openclaw" but resolveOpenClawPackageRoot failed for other reasons
|
// Package named "openclaw" but resolveOpenClawPackageRoot failed for other reasons
|
||||||
await fs.writeFile(path.join(tmp, "package.json"), JSON.stringify({ name: "openclaw" }));
|
await fs.writeFile(path.join(tmp, "package.json"), JSON.stringify({ name: "openclaw" }));
|
||||||
await fs.writeFile(path.join(tmp, "openclaw.mjs"), "export {};\n");
|
await fs.writeFile(path.join(tmp, "openclaw.mjs"), "export {};\n");
|
||||||
@@ -179,14 +173,11 @@ describe("control UI assets helpers", () => {
|
|||||||
expect(await resolveControlUiDistIndexPath(path.join(tmp, "openclaw.mjs"))).toBe(
|
expect(await resolveControlUiDistIndexPath(path.join(tmp, "openclaw.mjs"))).toBe(
|
||||||
path.join(tmp, "dist", "control-ui", "index.html"),
|
path.join(tmp, "dist", "control-ui", "index.html"),
|
||||||
);
|
);
|
||||||
} finally {
|
});
|
||||||
await fs.rm(tmp, { recursive: true, force: true });
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("returns null when package name does not match openclaw", async () => {
|
it("returns null when package name does not match openclaw", async () => {
|
||||||
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-ui-"));
|
await withTempDir(async (tmp) => {
|
||||||
try {
|
|
||||||
// Package with different name should not be resolved
|
// Package with different name should not be resolved
|
||||||
await fs.writeFile(path.join(tmp, "package.json"), JSON.stringify({ name: "malicious-pkg" }));
|
await fs.writeFile(path.join(tmp, "package.json"), JSON.stringify({ name: "malicious-pkg" }));
|
||||||
await fs.writeFile(path.join(tmp, "index.mjs"), "export {};\n");
|
await fs.writeFile(path.join(tmp, "index.mjs"), "export {};\n");
|
||||||
@@ -194,27 +185,21 @@ describe("control UI assets helpers", () => {
|
|||||||
await fs.writeFile(path.join(tmp, "dist", "control-ui", "index.html"), "<html></html>\n");
|
await fs.writeFile(path.join(tmp, "dist", "control-ui", "index.html"), "<html></html>\n");
|
||||||
|
|
||||||
expect(await resolveControlUiDistIndexPath(path.join(tmp, "index.mjs"))).toBeNull();
|
expect(await resolveControlUiDistIndexPath(path.join(tmp, "index.mjs"))).toBeNull();
|
||||||
} finally {
|
});
|
||||||
await fs.rm(tmp, { recursive: true, force: true });
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("returns null when no control-ui assets exist", async () => {
|
it("returns null when no control-ui assets exist", async () => {
|
||||||
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-ui-"));
|
await withTempDir(async (tmp) => {
|
||||||
try {
|
|
||||||
// Just a package.json, no dist/control-ui
|
// Just a package.json, no dist/control-ui
|
||||||
await fs.writeFile(path.join(tmp, "package.json"), JSON.stringify({ name: "some-pkg" }));
|
await fs.writeFile(path.join(tmp, "package.json"), JSON.stringify({ name: "some-pkg" }));
|
||||||
await fs.writeFile(path.join(tmp, "index.mjs"), "export {};\n");
|
await fs.writeFile(path.join(tmp, "index.mjs"), "export {};\n");
|
||||||
|
|
||||||
expect(await resolveControlUiDistIndexPath(path.join(tmp, "index.mjs"))).toBeNull();
|
expect(await resolveControlUiDistIndexPath(path.join(tmp, "index.mjs"))).toBeNull();
|
||||||
} finally {
|
});
|
||||||
await fs.rm(tmp, { recursive: true, force: true });
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("reports health for existing control-ui assets at a known root", async () => {
|
it("reports health for existing control-ui assets at a known root", async () => {
|
||||||
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-ui-"));
|
await withTempDir(async (tmp) => {
|
||||||
try {
|
|
||||||
const indexPath = resolveControlUiDistIndexPathForRoot(tmp);
|
const indexPath = resolveControlUiDistIndexPathForRoot(tmp);
|
||||||
await fs.mkdir(path.dirname(indexPath), { recursive: true });
|
await fs.mkdir(path.dirname(indexPath), { recursive: true });
|
||||||
await fs.writeFile(indexPath, "<html></html>\n");
|
await fs.writeFile(indexPath, "<html></html>\n");
|
||||||
@@ -223,27 +208,21 @@ describe("control UI assets helpers", () => {
|
|||||||
indexPath,
|
indexPath,
|
||||||
exists: true,
|
exists: true,
|
||||||
});
|
});
|
||||||
} finally {
|
});
|
||||||
await fs.rm(tmp, { recursive: true, force: true });
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("reports health for missing control-ui assets at a known root", async () => {
|
it("reports health for missing control-ui assets at a known root", async () => {
|
||||||
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-ui-"));
|
await withTempDir(async (tmp) => {
|
||||||
try {
|
|
||||||
const indexPath = resolveControlUiDistIndexPathForRoot(tmp);
|
const indexPath = resolveControlUiDistIndexPathForRoot(tmp);
|
||||||
await expect(resolveControlUiDistIndexHealth({ root: tmp })).resolves.toEqual({
|
await expect(resolveControlUiDistIndexHealth({ root: tmp })).resolves.toEqual({
|
||||||
indexPath,
|
indexPath,
|
||||||
exists: false,
|
exists: false,
|
||||||
});
|
});
|
||||||
} finally {
|
});
|
||||||
await fs.rm(tmp, { recursive: true, force: true });
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("resolves control-ui root when argv1 is a symlink (nvm scenario)", async () => {
|
it("resolves control-ui root when argv1 is a symlink (nvm scenario)", async () => {
|
||||||
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-ui-"));
|
await withTempDir(async (tmp) => {
|
||||||
try {
|
|
||||||
const realPkg = path.join(tmp, "real-pkg");
|
const realPkg = path.join(tmp, "real-pkg");
|
||||||
const bin = path.join(tmp, "bin");
|
const bin = path.join(tmp, "bin");
|
||||||
await fs.mkdir(realPkg, { recursive: true });
|
await fs.mkdir(realPkg, { recursive: true });
|
||||||
@@ -265,14 +244,11 @@ describe("control UI assets helpers", () => {
|
|||||||
expect(await canonicalPath(resolvedRoot ?? "")).toBe(
|
expect(await canonicalPath(resolvedRoot ?? "")).toBe(
|
||||||
await canonicalPath(path.join(realPkg, "dist", "control-ui")),
|
await canonicalPath(path.join(realPkg, "dist", "control-ui")),
|
||||||
);
|
);
|
||||||
} finally {
|
});
|
||||||
await fs.rm(tmp, { recursive: true, force: true });
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("resolves package root via symlinked argv1", async () => {
|
it("resolves package root via symlinked argv1", async () => {
|
||||||
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-ui-"));
|
await withTempDir(async (tmp) => {
|
||||||
try {
|
|
||||||
const realPkg = path.join(tmp, "real-pkg");
|
const realPkg = path.join(tmp, "real-pkg");
|
||||||
const bin = path.join(tmp, "bin");
|
const bin = path.join(tmp, "bin");
|
||||||
await fs.mkdir(realPkg, { recursive: true });
|
await fs.mkdir(realPkg, { recursive: true });
|
||||||
@@ -292,14 +268,11 @@ describe("control UI assets helpers", () => {
|
|||||||
const packageRoot = await resolveOpenClawPackageRoot({ argv1: path.join(bin, "openclaw") });
|
const packageRoot = await resolveOpenClawPackageRoot({ argv1: path.join(bin, "openclaw") });
|
||||||
expect(packageRoot).not.toBeNull();
|
expect(packageRoot).not.toBeNull();
|
||||||
expect(await canonicalPath(packageRoot ?? "")).toBe(await canonicalPath(realPkg));
|
expect(await canonicalPath(packageRoot ?? "")).toBe(await canonicalPath(realPkg));
|
||||||
} finally {
|
});
|
||||||
await fs.rm(tmp, { recursive: true, force: true });
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("resolves dist index path via symlinked argv1 (async)", async () => {
|
it("resolves dist index path via symlinked argv1 (async)", async () => {
|
||||||
const tmp = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-ui-"));
|
await withTempDir(async (tmp) => {
|
||||||
try {
|
|
||||||
const realPkg = path.join(tmp, "real-pkg");
|
const realPkg = path.join(tmp, "real-pkg");
|
||||||
const bin = path.join(tmp, "bin");
|
const bin = path.join(tmp, "bin");
|
||||||
await fs.mkdir(realPkg, { recursive: true });
|
await fs.mkdir(realPkg, { recursive: true });
|
||||||
@@ -321,8 +294,6 @@ describe("control UI assets helpers", () => {
|
|||||||
expect(await canonicalPath(indexPath ?? "")).toBe(
|
expect(await canonicalPath(indexPath ?? "")).toBe(
|
||||||
await canonicalPath(path.join(realPkg, "dist", "control-ui", "index.html")),
|
await canonicalPath(path.join(realPkg, "dist", "control-ui", "index.html")),
|
||||||
);
|
);
|
||||||
} finally {
|
});
|
||||||
await fs.rm(tmp, { recursive: true, force: true });
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user