fixed tests

This commit is contained in:
Bojan Kucera 2025-06-07 13:24:40 -04:00
parent 3d9afd711e
commit 3b8135d04b

View file

@ -25,8 +25,7 @@ describe('HTTP Integration Tests', () => {
beforeAll(() => {
client = new HttpClient({
timeout: 10000,
retries: 1
timeout: 10000
});
});
@ -40,7 +39,7 @@ describe('HTTP Integration Tests', () => {
expect(response.data).toHaveProperty('title');
expect(response.data).toHaveProperty('body');
} catch (error) {
console.warn('External API test skipped due to network issues:', error.message);
console.warn('External API test skipped due to network issues:', (error as Error).message);
}
});
@ -52,7 +51,7 @@ describe('HTTP Integration Tests', () => {
expect(Array.isArray(response.data)).toBe(true);
expect(response.data.length).toBeGreaterThan(0);
} catch (error) {
console.warn('Large response test skipped due to network issues:', error.message);
console.warn('Large response test skipped due to network issues:', (error as Error).message);
}
});
@ -70,7 +69,7 @@ describe('HTTP Integration Tests', () => {
expect(response.data).toHaveProperty('id');
expect(response.data.title).toBe(postData.title);
} catch (error) {
console.warn('POST integration test skipped due to network issues:', error.message);
console.warn('POST integration test skipped due to network issues:', (error as Error).message);
}
});
});
@ -138,8 +137,7 @@ describe('HTTP Integration Tests', () => {
test('should maintain connection efficiency', async () => {
const clientWithKeepAlive = new HttpClient({
timeout: 5000,
keepAlive: true
timeout: 5000
});
const requests = Array.from({ length: 3 }, () =>