Skip to content

Commit 7e11a7e

Browse files
committed
fix: webpack-dev-server support, close #4
1 parent 865561c commit 7e11a7e

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ If you use convention and name your scripts "start" and "test" you can simply pr
4949
}
5050
```
5151

52+
## Note for webpack-dev-server users
53+
54+
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
55+
56+
```
57+
start-server-and-test http-get://localhost:8080
58+
```
59+
60+
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.
61+
5262
### Debugging
5363

5464
To see diagnostic messages, run with environment variable `DEBUG=start-server-and-test`

package.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,6 @@
7878
"demo2": "node bin/start.js start http://127.0.0.1:9000 test2",
7979
"demo3": "node bin/start.js start-with-child http://127.0.0.1:9000 test"
8080
},
81-
"release": {
82-
"analyzeCommits": "simple-commit-message",
83-
"generateNotes": "github-post-release",
84-
"verifyRelease": {
85-
"path": "dont-crack",
86-
"test-against": []
87-
}
88-
},
8981
"devDependencies": {
9082
"ban-sensitive-files": "1.9.2",
9183
"dependency-check": "2.9.1",

src/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ function startAndTest ({ start, url, test }) {
4444
waitOn(
4545
{
4646
resources: [url],
47-
interval: 1000,
48-
window: 100,
49-
verbose: isDebug()
47+
interval: 2000,
48+
window: 1000,
49+
verbose: isDebug(),
50+
log: isDebug()
5051
},
5152
err => {
5253
if (err) {

0 commit comments

Comments
 (0)