From 3c911485edc62ce14114209c4c9ec282d1ae570d Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Thu, 26 Feb 2026 12:48:32 +0000 Subject: [PATCH] Address Copilot's review comments --- src/start-proxy.test.ts | 24 +++++++++++++----------- src/start-proxy.ts | 1 + 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/start-proxy.test.ts b/src/start-proxy.test.ts index 514f0686c..eb8fb5a5c 100644 --- a/src/start-proxy.test.ts +++ b/src/start-proxy.test.ts @@ -15,7 +15,6 @@ import { parseLanguage } from "./start-proxy"; import * as statusReport from "./status-report"; import { checkExpectedLogMessages, - createFeatures, getRecordingLogger, makeTestToken, RecordingLogger, @@ -392,19 +391,22 @@ function mockOfflineFeatures(tempDir: string, logger: Logger) { } test("getDownloadUrl returns fallback when `getReleaseByVersion` rejects", async (t) => { + const logger = new RecordingLogger(); mockGetReleaseByTag(); - const features = createFeatures([]); - const info = await startProxyExports.getDownloadUrl( - getRunnerLogger(true), - features, - ); + await withTmpDir(async (tempDir) => { + const features = mockOfflineFeatures(tempDir, logger); + const info = await startProxyExports.getDownloadUrl( + getRunnerLogger(true), + features, + ); - t.is(info.version, startProxyExports.UPDATEJOB_PROXY_VERSION); - t.is( - info.url, - startProxyExports.getFallbackUrl(startProxyExports.getProxyPackage()), - ); + t.is(info.version, startProxyExports.UPDATEJOB_PROXY_VERSION); + t.is( + info.url, + startProxyExports.getFallbackUrl(startProxyExports.getProxyPackage()), + ); + }); }); test("getDownloadUrl returns fallback when there's no matching release asset", async (t) => { diff --git a/src/start-proxy.ts b/src/start-proxy.ts index 43ff58ebf..03bdd7c9d 100644 --- a/src/start-proxy.ts +++ b/src/start-proxy.ts @@ -410,6 +410,7 @@ async function getReleaseByVersion(version: string) { * already in the toolcache, and its version. * * @param logger The logger to use. + * @param features Information about enabled features. * @returns Returns the download URL and version of the proxy package we plan to use. */ export async function getDownloadUrl(