From 7da2d98d9d82596f5f9acd582759aa5bae02a05b Mon Sep 17 00:00:00 2001 From: garrytan Date: Mon, 26 Oct 2026 21:33:57 +0000 Subject: [PATCH] test(pr-wait): function declarations for the fake-gh helpers so the pregate TSX import scanner maps the lib files Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- test/pr-wait.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/pr-wait.test.ts b/test/pr-wait.test.ts index 6733a8d02..9f338d04c 100644 --- a/test/pr-wait.test.ts +++ b/test/pr-wait.test.ts @@ -63,10 +63,11 @@ interface Script { behind?: GhResult; } function fakeGh(script: Script) { - const queue = (value: T | T[] | undefined): T[] => (value === undefined ? [] : Array.isArray(value) ? [...value] : [value]); + // Function declarations, not generic arrows: pregate's import scanner reads tests as TSX, where `(x) =>` is a tag. + function queue(value: T | T[] | undefined): T[] { return value === undefined ? [] : Array.isArray(value) ? [...value] : [value]; } + function next(q: T[]): T | undefined { return q.length > 1 ? q.shift() : q[0]; } const prs = queue(script.pr).map(ok); const checks = queue(script.checks); - const next = (q: T[]): T | undefined => (q.length > 1 ? q.shift() : q[0]); const calls: string[][] = []; const gh = (args: string[]): GhResult => { calls.push(args);