test: Create single function for port generation

This reduces the chances of several integration tests
re-using the same port.
This commit is contained in:
Joachim Van Herwegen
2021-04-16 11:21:50 +02:00
parent d1eadd75e7
commit fa8d406f34
8 changed files with 35 additions and 7 deletions

View File

@@ -2,9 +2,10 @@ import type { Server } from 'http';
import fetch from 'cross-fetch';
import type { Initializer } from '../../src/init/Initializer';
import type { HttpServerFactory } from '../../src/server/HttpServerFactory';
import { getPort } from '../util/Util';
import { instantiateFromConfig } from './Config';
const port = 6004;
const port = getPort('ServerFetch');
const baseUrl = `http://localhost:${port}/`;
// Some tests with real Requests/Responses until the mocking library has been removed from the tests