Skip to content

Commit

Permalink
Change the default standalone port to 45454
Browse files Browse the repository at this point in the history
This should be an invisible change to end users, as long as you're not
explicitly specifying the standalone server port in browsers tests
on only one side of the client/server setup.

Makes no functional difference, except for ensuring that HTTP Toolkit
itself doesn't have a port conflict with Mockttp tests when both are run
on the same machine.
  • Loading branch information
pimterry committed Aug 17, 2020
1 parent 7fe2044 commit c95a963
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/standalone/mockttp-standalone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ export class MockttpStandalone {
}));
}

async start(listenOptions: number | {
async start(
listenOptions: number | {
port: number,
host: string
} = DEFAULT_STANDALONE_PORT
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import stream = require('stream');
import http = require('http');
import { EventEmitter } from 'events';

export const DEFAULT_STANDALONE_PORT = 45456;
export const DEFAULT_STANDALONE_PORT = 45454;

export enum Method {
GET,
Expand Down
2 changes: 1 addition & 1 deletion standalone-graphiql.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ standalone.start().then(() => {
}).then(() => {
console.log('Mock server started');
server.get('/').thenReply(200, 'hi!');
opn('http://localhost:45456/graphiql')
opn('http://localhost:45454/graphiql')
});
2 changes: 1 addition & 1 deletion test/integration/remote-client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ nodeOnly(() => {
let client = getRemote();

await expect(client.start())
.to.eventually.be.rejectedWith('Failed to connect to standalone server at http://localhost:45456');
.to.eventually.be.rejectedWith('Failed to connect to standalone server at http://localhost:45454');
});
});

Expand Down

0 comments on commit c95a963

Please sign in to comment.