fixed tests
This commit is contained in:
parent
3d9afd711e
commit
3b8135d04b
1 changed files with 5 additions and 7 deletions
|
|
@ -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 }, () =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue