From 1968db9ddd2a0da043e1f4e224bb371b609624f9 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 8 May 2026 22:52:04 +0100 Subject: [PATCH] test: simplify pi package missing scan --- src/plugins/pi-package-graph.test.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/plugins/pi-package-graph.test.ts b/src/plugins/pi-package-graph.test.ts index 07fb8147f54..04e92e5d806 100644 --- a/src/plugins/pi-package-graph.test.ts +++ b/src/plugins/pi-package-graph.test.ts @@ -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(", ") || ""}. Mixed or incomplete Pi root dependencies create an unsupported package graph.`,