Skip to content

Commit

Permalink
chore: added closeOnExec param to ./bin/server
Browse files Browse the repository at this point in the history
  • Loading branch information
lquixada committed Aug 4, 2021
1 parent 80c46c1 commit 6baf09d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions bin/server
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,12 @@ const server = app.listen(port, hostname, () => {

child.stdout.pipe(process.stdout)
child.stderr.pipe(process.stdout)
child.on('exit', code => {
server.close()
process.exit(code)
})

if (argv.closeOnExec) {
child.on('exit', code => {
server.close()
process.exit(code)
})
}
}
})
2 changes: 1 addition & 1 deletion test/fetch/browser/run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh
browser="./node_modules/.bin/mocha-headless-chrome"
./bin/server --exec "$browser -f $(dirname $0)/index.html?globals=on"
./bin/server --exec "$browser -f $(dirname $0)/index.html?globals=on" --closeOnExec
2 changes: 1 addition & 1 deletion test/fetch/node/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
nyc="./node_modules/.bin/nyc"
mocha="./node_modules/.bin/mocha"
./bin/server --exec "$nyc $mocha $(dirname $0)/index.js"
./bin/server --exec "$nyc $mocha $(dirname $0)/index.js" --closeOnExec
2 changes: 1 addition & 1 deletion test/fetch/whatwg/run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh
browser="./node_modules/.bin/mocha-headless-chrome"
./bin/server --exec "$browser -f $(dirname $0)/index.html?globals=off"
./bin/server --exec "$browser -f $(dirname $0)/index.html?globals=off" --closeOnExec

0 comments on commit 6baf09d

Please sign in to comment.