mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 22:10:41 +00:00
test: simplify pi package missing scan
This commit is contained in:
@@ -37,6 +37,16 @@ function readPiDependencySpecs() {
|
||||
}));
|
||||
}
|
||||
|
||||
function collectMissingSpecNames(specs: Array<{ name: string; spec?: string }>): string[] {
|
||||
const names: string[] = [];
|
||||
for (const entry of specs) {
|
||||
if (!entry.spec) {
|
||||
names.push(entry.name);
|
||||
}
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
function expectNoGraphViolations(violations: string[], message: string) {
|
||||
expect(violations, message).toEqual([]);
|
||||
}
|
||||
@@ -45,7 +55,7 @@ describe("pi package graph guardrails", () => {
|
||||
it("keeps root Pi packages aligned to the same exact version", () => {
|
||||
const specs = readPiDependencySpecs();
|
||||
|
||||
const missing = specs.filter((entry) => !entry.spec).map((entry) => entry.name);
|
||||
const missing = collectMissingSpecNames(specs);
|
||||
expectNoGraphViolations(
|
||||
missing,
|
||||
`Missing required root Pi dependencies: ${missing.join(", ") || "<none>"}. Mixed or incomplete Pi root dependencies create an unsupported package graph.`,
|
||||
|
||||
Reference in New Issue
Block a user