Skip to content

Commit

Permalink
feat(jest-dev-server): add support for protocol & host (argos-ci#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nico authored and gregberge committed Jul 11, 2018
1 parent 6c8cc96 commit 8441f9f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
30 changes: 30 additions & 0 deletions 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 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

0 comments on commit 8441f9f

Please sign in to comment.