


























@@ -6,11 +6,10 @@ import { withTempDir } from "../test-helpers/temp-dir.js";
66import {
77assertNoLegacyPluginDependencyStagingDebris,
88collectLegacyPluginDependencyStagingDebrisPaths,
9-collectPackageDistInventoryErrors,
109LOCAL_BUILD_METADATA_DIST_PATHS,
11-PACKAGE_DIST_INVENTORY_RELATIVE_PATH,
1210collectPackageDistInventory,
1311isLegacyPluginDependencyInstallStagePath,
12+readPackageDistInventoryIfPresent,
1413writePackageDistInventory,
1514} from "./package-dist-inventory.js";
1615@@ -24,7 +23,9 @@ describe("package dist inventory", () => {
2423await expect(writePackageDistInventory(packageRoot)).resolves.toEqual([
2524"dist/current-BR6xv1a1.js",
2625]);
27-await expect(collectPackageDistInventoryErrors(packageRoot)).resolves.toStrictEqual([]);
26+await expect(readPackageDistInventoryIfPresent(packageRoot)).resolves.toStrictEqual([
27+"dist/current-BR6xv1a1.js",
28+]);
28292930await fs.rm(currentFile);
3031await fs.writeFile(
@@ -33,9 +34,8 @@ describe("package dist inventory", () => {
3334"utf8",
3435);
353636-await expect(collectPackageDistInventoryErrors(packageRoot)).resolves.toEqual([
37-"missing packaged dist file dist/current-BR6xv1a1.js",
38-"unexpected packaged dist file dist/stale-CJUAgRQR.js",
37+await expect(collectPackageDistInventory(packageRoot)).resolves.toEqual([
38+"dist/stale-CJUAgRQR.js",
3939]);
4040});
4141});
@@ -400,9 +400,9 @@ describe("package dist inventory", () => {
400400await fs.mkdir(path.dirname(suffixedStageFile), { recursive: true });
401401await fs.writeFile(suffixedStageFile, "{}", "utf8");
402402403-await expect(collectPackageDistInventoryErrors(packageRoot)).resolves.toEqual([
404-"unexpected packaged dist file dist/extensions/brave/.openclaw-install-stage/node_modules/typebox/build/compile/code.mjs",
405-"unexpected packaged dist file dist/extensions/browser/.openclaw-install-stage-AbC123/node_modules/playwright-core/package.json",
403+await expect(collectLegacyPluginDependencyStagingDebrisPaths(packageRoot)).resolves.toEqual([
404+"dist/extensions/brave/.openclaw-install-stage",
405+"dist/extensions/browser/.openclaw-install-stage-AbC123",
406406]);
407407});
408408});
@@ -531,12 +531,10 @@ describe("package dist inventory", () => {
531531});
532532});
533533534-it("fails closed when the inventory is missing", async () => {
534+it("returns null when the inventory is missing", async () => {
535535await withTempDir({ prefix: "openclaw-dist-inventory-missing-" }, async (packageRoot) => {
536536await fs.mkdir(path.join(packageRoot, "dist"), { recursive: true });
537-await expect(collectPackageDistInventoryErrors(packageRoot)).resolves.toEqual([
538-`missing package dist inventory ${PACKAGE_DIST_INVENTORY_RELATIVE_PATH}`,
539-]);
537+await expect(readPackageDistInventoryIfPresent(packageRoot)).resolves.toBeNull();
540538});
541539});
542540此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。