Update jetbrains-installer Tests

This commit is contained in:
Gregory Mitchell 2024-11-28 19:43:24 +00:00 committed by GitHub
parent 393543671a
commit 847079da47
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -25,22 +25,11 @@ describe('getAvailableVersions', () => {
it('load available versions', async () => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
spyHttpClient
.mockReturnValueOnce({
statusCode: 200,
headers: {},
result: manifestData as any
})
.mockReturnValueOnce({
statusCode: 200,
headers: {},
result: manifestData as any
})
.mockReturnValueOnce({
statusCode: 200,
headers: {},
result: []
});
spyHttpClient.mockReturnValueOnce({
statusCode: 200,
headers: {},
result: manifestData as any
});
const distribution = new JetBrainsDistribution({
version: '17',
@ -53,8 +42,8 @@ describe('getAvailableVersions', () => {
const length =
os.platform() === 'win32'
? manifestData.length * 2 - 4
: manifestData.length * 2;
? manifestData.length - 2
: manifestData.length + 1;
expect(availableVersions.length).toBe(length);
}, 10_000);
});