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