Skip to content

Commit

Permalink
fix(jest-dev-server): no default host
Browse files Browse the repository at this point in the history
BREAKING CHANGE: default host is now `undefined` instead of "localhost"
  • Loading branch information
gregberge committed May 24, 2023
1 parent 351720a commit c35e403
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/jest-dev-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Following options are linked to [`spawnd`](https://www.npmjs.com/package/spawnd)

### `host`

Type: `string`, default to `localhost`.
Type: `string`, if not specified it will used Node.js default port.

Host to wait for activity on before considering the server running.
Must be used in conjunction with `port`.
Expand Down
5 changes: 2 additions & 3 deletions packages/jest-dev-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export type Config = {
launchTimeout?: number;
/**
* Host to use to check if the port is used.
* @default "localhost"
*/
host?: string;
/**
Expand Down Expand Up @@ -69,7 +68,7 @@ const DEFAULT_CONFIG: Partial<Config> = {
debug: false,
options: {},
launchTimeout: 5000,
host: "localhost",
host: undefined,
port: undefined,
protocol: "tcp",
usedPortAction: "ask",
Expand Down Expand Up @@ -238,7 +237,7 @@ const waitForServerToBeReady = async (config: Config) => {
if (config.port === undefined) return;
const { launchTimeout, protocol, host, port, path, waitOnScheme } = config;

let resource = `${host}:${port}`;
let resource = `${host ?? "0.0.0.0"}:${port}`;
if (path) {
resource = `${resource}/${path}`;
}
Expand Down

0 comments on commit c35e403

Please sign in to comment.