exit if mock servers fail to start

This commit is contained in:
Brian Gough 2017-10-20 15:19:20 +01:00
parent c1b5e1d04c
commit 168d646328
2 changed files with 10 additions and 2 deletions

View file

@ -38,5 +38,9 @@ module.exports = MockDocUpdaterServer =
app.listen 3003, (error) -> app.listen 3003, (error) ->
MockDocUpdaterServer.running = true MockDocUpdaterServer.running = true
callback(error) callback(error)
.on "error", (error) ->
console.error "error starting MockDocUpdaterServer:", error.message
process.exit(1)
sinon.spy MockDocUpdaterServer, "getDocument" sinon.spy MockDocUpdaterServer, "getDocument"

View file

@ -35,5 +35,9 @@ module.exports = MockWebServer =
app.listen 3000, (error) -> app.listen 3000, (error) ->
MockWebServer.running = true MockWebServer.running = true
callback(error) callback(error)
.on "error", (error) ->
console.error "error starting MockWebServer:", error.message
process.exit(1)
sinon.spy MockWebServer, "joinProject" sinon.spy MockWebServer, "joinProject"