Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for protocol in jest-dev-server #93

Merged
merged 3 commits into from
Jul 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions packages/jest-dev-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,36 @@ Type: `object`, default to `{}`.

Any other options to pass to [`spawnd`](https://www.npmjs.com/package/spawnd).

#### `host`

Type: `string`, default to `localhost`.

Host to wait for activity on before considering the server running.
Must be used in conjunction with `port`.

```js
module.exports = {
command: 'npm run start --port 3000',
host: 'customhost.com',
port: 3000
}
```

#### `protocol`

Type: `string`, default to `null`.

To wait for an HTTP endpoint before considering the server running, include `http` as a protocol.
Must be used in conjunction with `port`.

```js
module.exports = {
command: 'npm run start --port 3000',
protocol: 'http',
port: 3000
}
```

#### `port`

Type: `number`, default to `null`.
Expand Down
6 changes: 5 additions & 1 deletion packages/jest-dev-server/src/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ const DEFAULT_CONFIG = {
debug: false,
options: {},
launchTimeout: 5000,
host: null,
port: null,
protocol: null,
usedPortAction: 'ask',
}

Expand Down Expand Up @@ -155,8 +157,10 @@ export async function setup(config) {
)
}),
waitPort({
port: config.port,
host: config.host,
output: 'silent',
port: config.port,
protocol: config.protocol,
}),
])
clearTimeout(timeout)
Expand Down