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

@@ -4,12 +4,14 @@ import type { RedisResourceLocker } from '../../src';
import { joinFilePath } from '../../src';
import type { HttpServerFactory } from '../../src/server/HttpServerFactory';
import { describeIf } from '../util/TestHelpers';
import { getPort } from '../util/Util';
import { instantiateFromConfig } from './Config';
/**
* Test the general functionality of the server using a RedisResourceLocker
*/
describeIf('docker', 'A server with a RedisResourceLocker as ResourceLocker', (): void => {
const port = 6008;
const port = getPort('RedisResourceLocker');
const baseUrl = `http://localhost:${port}/`;
let server: Server;
let locker: RedisResourceLocker;