From 3721876b1b2a9841d65f7b0d1d03eaadc1101ab2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 4 Apr 2026 07:28:44 +0000 Subject: [PATCH] Revert JetBrains test mock: use real network calls now that cloudfront.net is whitelisted Agent-Logs-Url: https://github.com/nbauma109/setup-java/sessions/74ae64af-1192-420c-8c3e-aefa09bfb00a Co-authored-by: nbauma109 <9403560+nbauma109@users.noreply.github.com> --- __tests__/distributors/jetbrains-installer.test.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/__tests__/distributors/jetbrains-installer.test.ts b/__tests__/distributors/jetbrains-installer.test.ts index 07d6219e..44d8ef89 100644 --- a/__tests__/distributors/jetbrains-installer.test.ts +++ b/__tests__/distributors/jetbrains-installer.test.ts @@ -3,10 +3,10 @@ import {HttpClient} from '@actions/http-client'; import {JetBrainsDistribution} from '../../src/distributions/jetbrains/installer'; import manifestData from '../data/jetbrains.json'; +import os from 'os'; describe('getAvailableVersions', () => { let spyHttpClient: jest.SpyInstance; - let spyHttpClientHead: jest.SpyInstance; beforeEach(() => { spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson'); @@ -15,10 +15,6 @@ describe('getAvailableVersions', () => { headers: {}, result: [] }); - spyHttpClientHead = jest.spyOn(HttpClient.prototype, 'head'); - spyHttpClientHead.mockReturnValue({ - message: {statusCode: 200} - }); }); afterEach(() => { @@ -44,8 +40,9 @@ describe('getAvailableVersions', () => { const availableVersions = await distribution['getAvailableVersions'](); expect(availableVersions).not.toBeNull(); - // manifestData items + 2 hidden versions (always included when head is mocked to return 200) - expect(availableVersions.length).toBe(manifestData.length + 2); + const length = + os.platform() === 'win32' ? manifestData.length : manifestData.length + 2; + expect(availableVersions.length).toBe(length); }, 10_000); });