diff --git a/packages/case-core/src/__tests__/server/http/connectors/web/index.ts b/packages/case-core/src/__tests__/server/http/connectors/web/index.ts index 7e8e88d4..f9d906f2 100644 --- a/packages/case-core/src/__tests__/server/http/connectors/web/index.ts +++ b/packages/case-core/src/__tests__/server/http/connectors/web/index.ts @@ -8,7 +8,7 @@ import type { Dependencies } from '../../domain/types'; import { userRepo } from '../users/defaultUserRepository'; const app = express(); -const PORT = 8282; // default port to listen +const PORT = 8289; // default port to listen const defaultDependencies: Dependencies = { baseService, diff --git a/packages/case-core/src/__tests__/server/http/index.ts b/packages/case-core/src/__tests__/server/http/index.ts index 95733e9c..cd2ecd68 100644 --- a/packages/case-core/src/__tests__/server/http/index.ts +++ b/packages/case-core/src/__tests__/server/http/index.ts @@ -1,4 +1,4 @@ import type * as http from 'http'; import start from './connectors/web'; -export default (): Promise => start(); +export default (port: number): Promise => start(port); diff --git a/packages/case-core/src/index.http.response.internals.spec.ts b/packages/case-core/src/index.http.response.internals.spec.ts index fac35dec..349b4415 100644 --- a/packages/case-core/src/index.http.response.internals.spec.ts +++ b/packages/case-core/src/index.http.response.internals.spec.ts @@ -15,6 +15,8 @@ import { WritingCaseContract } from './core'; import { writerDependencies } from './connectors/dependencies'; import { defaultPrinter } from './__tests__/jest/defaultTestPrinter'; +const PORT = 8084; + const expectErrorContaining = async ( context: Promise, expectedContent: string, @@ -83,7 +85,7 @@ describe('simple get endpoint', () => { } = { mockConfig: { http: { - baseUrlUnderTest: `http://localhost:8282`, + baseUrlUnderTest: `http://localhost:${PORT}`, }, }, contractMode: 'read', @@ -110,7 +112,7 @@ describe('simple get endpoint', () => { describe('with a running server', () => { let server: http.Server; beforeAll(async () => { - server = await start(); + server = await start(PORT); }); afterAll(() => { const closePromise = new Promise((resolve) => { diff --git a/packages/contract-case-jest/src/__tests__/server/http/index.ts b/packages/contract-case-jest/src/__tests__/server/http/index.ts index 094320ae..6e6eafcf 100644 --- a/packages/contract-case-jest/src/__tests__/server/http/index.ts +++ b/packages/contract-case-jest/src/__tests__/server/http/index.ts @@ -1,4 +1,4 @@ import type * as http from 'http'; import start from './connectors/web/index.js'; -export default (): Promise => start(); +export default (port: number): Promise => start(port);