overleaf/services/contacts/test/acceptance/coffee/ContactsApp.coffee

20 lines
462 B
CoffeeScript
Raw Normal View History

2018-05-23 10:01:07 +00:00
app = require('../../../app')
require("logger-sharelatex").logger.level("error")
module.exports =
running: false
initing: false
callbacks: []
ensureRunning: (callback = (error) ->) ->
if @running
return callback()
else if @initing
@callbacks.push callback
else
@initing = true
@callbacks.push callback
app.listen 3036, "localhost", (error) =>
throw error if error?
@running = true
for callback in @callbacks
callback()