Skip to content

Commit 3c91148

Browse files
committed
Address Copilot's review comments
1 parent f657c4e commit 3c91148

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

src/start-proxy.test.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { parseLanguage } from "./start-proxy";
1515
import * as statusReport from "./status-report";
1616
import {
1717
checkExpectedLogMessages,
18-
createFeatures,
1918
getRecordingLogger,
2019
makeTestToken,
2120
RecordingLogger,
@@ -392,19 +391,22 @@ function mockOfflineFeatures(tempDir: string, logger: Logger) {
392391
}
393392

394393
test("getDownloadUrl returns fallback when `getReleaseByVersion` rejects", async (t) => {
394+
const logger = new RecordingLogger();
395395
mockGetReleaseByTag();
396396

397-
const features = createFeatures([]);
398-
const info = await startProxyExports.getDownloadUrl(
399-
getRunnerLogger(true),
400-
features,
401-
);
397+
await withTmpDir(async (tempDir) => {
398+
const features = mockOfflineFeatures(tempDir, logger);
399+
const info = await startProxyExports.getDownloadUrl(
400+
getRunnerLogger(true),
401+
features,
402+
);
402403

403-
t.is(info.version, startProxyExports.UPDATEJOB_PROXY_VERSION);
404-
t.is(
405-
info.url,
406-
startProxyExports.getFallbackUrl(startProxyExports.getProxyPackage()),
407-
);
404+
t.is(info.version, startProxyExports.UPDATEJOB_PROXY_VERSION);
405+
t.is(
406+
info.url,
407+
startProxyExports.getFallbackUrl(startProxyExports.getProxyPackage()),
408+
);
409+
});
408410
});
409411

410412
test("getDownloadUrl returns fallback when there's no matching release asset", async (t) => {

src/start-proxy.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ async function getReleaseByVersion(version: string) {
410410
* already in the toolcache, and its version.
411411
*
412412
* @param logger The logger to use.
413+
* @param features Information about enabled features.
413414
* @returns Returns the download URL and version of the proxy package we plan to use.
414415
*/
415416
export async function getDownloadUrl(

0 commit comments

Comments
 (0)