Skip to content

Commit 2a02cd5

Browse files
committed
chore: resolve test server port conflict
1 parent 29e2d39 commit 2a02cd5

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

impit-node/test/errors.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ import {
1313
InvalidURL,
1414
} from '../index.wrapper.js';
1515

16+
const SERVER_PORT = 3004;
1617
let localServer: Server | null = null;
1718

1819
beforeAll(async () => {
19-
localServer = await runServer(3003);
20+
localServer = await runServer(SERVER_PORT);
2021
});
2122

2223
afterAll(async () => {
@@ -57,7 +58,7 @@ describe('Integration: errors from fetch', () => {
5758
const impit = new Impit({ timeout: 1 });
5859

5960
try {
60-
await impit.fetch('http://127.0.0.1:3003/delay/3000');
61+
await impit.fetch(`http://127.0.0.1:${SERVER_PORT}/delay/3000`);
6162
expect.unreachable('should have thrown');
6263
} catch (e) {
6364
expect(e).toBeInstanceOf(TimeoutError);
@@ -68,7 +69,7 @@ describe('Integration: errors from fetch', () => {
6869

6970
test('request-level timeout throws TimeoutError', async () => {
7071
await expect(
71-
impit.fetch('http://127.0.0.1:3003/delay/3000', { timeout: 1 })
72+
impit.fetch(`http://127.0.0.1:${SERVER_PORT}/delay/3000`, { timeout: 1 })
7273
).rejects.toThrow(TimeoutError);
7374
});
7475

0 commit comments

Comments
 (0)