mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
refactor: validate bundled extension release metadata
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
collectAppcastSparkleVersionErrors,
|
||||
collectBundledExtensionManifestErrors,
|
||||
collectBundledExtensionRootDependencyGapErrors,
|
||||
} from "../scripts/release-check.ts";
|
||||
|
||||
@@ -110,3 +111,42 @@ describe("collectBundledExtensionRootDependencyGapErrors", () => {
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("collectBundledExtensionManifestErrors", () => {
|
||||
it("flags invalid bundled extension install metadata", () => {
|
||||
expect(
|
||||
collectBundledExtensionManifestErrors([
|
||||
{
|
||||
id: "broken",
|
||||
packageJson: {
|
||||
openclaw: {
|
||||
install: { npmSpec: " " },
|
||||
},
|
||||
},
|
||||
},
|
||||
]),
|
||||
).toEqual([
|
||||
"bundled extension 'broken' manifest invalid | openclaw.install.npmSpec must be a non-empty string",
|
||||
]);
|
||||
});
|
||||
|
||||
it("flags invalid release-check allowlist metadata", () => {
|
||||
expect(
|
||||
collectBundledExtensionManifestErrors([
|
||||
{
|
||||
id: "broken",
|
||||
packageJson: {
|
||||
openclaw: {
|
||||
install: { npmSpec: "@openclaw/broken" },
|
||||
releaseChecks: {
|
||||
rootDependencyMirrorAllowlist: ["ok", ""],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]),
|
||||
).toEqual([
|
||||
"bundled extension 'broken' manifest invalid | openclaw.releaseChecks.rootDependencyMirrorAllowlist must contain only non-empty strings",
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user