From a33d994e3a4f3e502d9c693a50fa40178bed4e08 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 8 May 2026 23:49:52 +0100 Subject: [PATCH] test: simplify ci changed scope output parsing --- src/scripts/ci-changed-scope.test.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/scripts/ci-changed-scope.test.ts b/src/scripts/ci-changed-scope.test.ts index 79fbb6e30fe..981bddf14c4 100644 --- a/src/scripts/ci-changed-scope.test.ts +++ b/src/scripts/ci-changed-scope.test.ts @@ -45,16 +45,15 @@ afterEach(() => { }); function parseGitHubOutput(output: string): Record { - return Object.fromEntries( - output - .trim() - .split("\n") - .filter(Boolean) - .map((line) => { - const separator = line.indexOf("="); - return [line.slice(0, separator), line.slice(separator + 1)]; - }), - ); + const parsed: Record = {}; + for (const line of output.trim().split("\n")) { + if (!line) { + continue; + } + const separator = line.indexOf("="); + parsed[line.slice(0, separator)] = line.slice(separator + 1); + } + return parsed; } describe("detectChangedScope", () => {