diff --git a/src/index.js b/src/index.js index 7ec5732..a6b2a96 100644 --- a/src/index.js +++ b/src/index.js @@ -65,7 +65,12 @@ function waitAndRun ({ start, url, runFn }) { }) .then(() => { debug('stopping server') - server.kill() + return new Promise((resolve, reject) => { + server.kill('SIGINT', { forceKillAfterTimeout: 10000 }) + server.on('exit', () => { + resolve() + }) + }) }) } }