Skip to content

Commit

Permalink
chore: Address race condition that could cause a local run of CI to fail
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyJones committed Nov 12, 2024
1 parent ace5ac9 commit 092f6f3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/case-core/src/__tests__/server/http/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type * as http from 'http';
import start from './connectors/web';

export default (): Promise<http.Server> => start();
export default (port: number): Promise<http.Server> => start(port);
6 changes: 4 additions & 2 deletions packages/case-core/src/index.http.response.internals.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<unknown>,
expectedContent: string,
Expand Down Expand Up @@ -83,7 +85,7 @@ describe('simple get endpoint', () => {
} = {
mockConfig: {
http: {
baseUrlUnderTest: `http://localhost:8282`,
baseUrlUnderTest: `http://localhost:${PORT}`,
},
},
contractMode: 'read',
Expand All @@ -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<void>((resolve) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type * as http from 'http';
import start from './connectors/web/index.js';

export default (): Promise<http.Server> => start();
export default (port: number): Promise<http.Server> => start(port);

0 comments on commit 092f6f3

Please sign in to comment.