From b62b4e683df8cfb84a66658c410f6c47e07d8fd3 Mon Sep 17 00:00:00 2001 From: Danathar <6772335+Danathar@users.noreply.github.com> Date: Tue, 17 Nov 2026 17:15:23 -0500 Subject: [PATCH] test: one extractFunction in governor-pr-models-ui.test.js Two PRs that merged into v5 each added a top-level extractFunction to this file. Function hoisting makes the later one win, and it slices from 'function', dropping 'async' from loadGovernorPRModelPRs, so the per-model PR list test fails to compile (await outside an async function) and server-tests is red on every v5 PR. Keep the first helper, which keeps 'async'; the per-repository test's use is the same. Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 --- dashboard/test/governor-pr-models-ui.test.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/dashboard/test/governor-pr-models-ui.test.js b/dashboard/test/governor-pr-models-ui.test.js index dd2af1a758..5bf6a80a8e 100644 --- a/dashboard/test/governor-pr-models-ui.test.js +++ b/dashboard/test/governor-pr-models-ui.test.js @@ -124,20 +124,6 @@ test('Governor PRs by model tooltip lists per-backend rework and the effort spli } }); -function extractFunction(name) { - const start = indexHtml.indexOf('function ' + name + '('); - assert.notEqual(start, -1, `${name} function exists`); - const brace = indexHtml.indexOf('{', start); - let depth = 0; - for (let i = brace; i < indexHtml.length; i++) { - const ch = indexHtml[i]; - if (ch === '{') depth++; - if (ch === '}') depth--; - if (depth === 0) return indexHtml.slice(start, i + 1); - } - throw new Error(`unterminated ${name}`); -} - test('Governor PRs by model tooltip lists repos and weekly trend when present (#18716)', () => { const vm = require('node:vm'); const ctx = {};