Skip to content

Commit

Permalink
fix: webpack-dev-server support, close #4
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Mar 30, 2018
1 parent 865561c commit 7e11a7e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ If you use convention and name your scripts "start" and "test" you can simply pr
}
```

## Note for webpack-dev-server users

If you are using [webpack-dev-server](https://www.npmjs.com/package/webpack-dev-server) (directly or via `angular/cli` or other boilerplates) then please use the following URL form to check

```
start-server-and-test http-get://localhost:8080
```

This is because under the hood this module uses [wait-on](https://github.com/jeffbski/wait-on) to ping the server. Wait-on uses `HEAD` by default, but `webpack-dev-server` does not respond to `HEAD` only to `GET` requests. Thus you need to use `http-get://` URL format to force `wait-on` to use `GET` probe.

### Debugging

To see diagnostic messages, run with environment variable `DEBUG=start-server-and-test`
Expand Down
8 changes: 0 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,6 @@
"demo2": "node bin/start.js start http://127.0.0.1:9000 test2",
"demo3": "node bin/start.js start-with-child http://127.0.0.1:9000 test"
},
"release": {
"analyzeCommits": "simple-commit-message",
"generateNotes": "github-post-release",
"verifyRelease": {
"path": "dont-crack",
"test-against": []
}
},
"devDependencies": {
"ban-sensitive-files": "1.9.2",
"dependency-check": "2.9.1",
Expand Down
7 changes: 4 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ function startAndTest ({ start, url, test }) {
waitOn(
{
resources: [url],
interval: 1000,
window: 100,
verbose: isDebug()
interval: 2000,
window: 1000,
verbose: isDebug(),
log: isDebug()
},
err => {
if (err) {
Expand Down

0 comments on commit 7e11a7e

Please sign in to comment.