overleaf/services/clsi/test/acceptance/coffee/helpers/ClsiApp.coffee
Henry Oswald f39d14bf1b unit tests pass, acceptence fail
uncomment tests
2018-03-02 17:34:41 +00:00

24 lines
No EOL
613 B
CoffeeScript

app = require('../../../../app')
require("logger-sharelatex").logger.level("info")
logger = require("logger-sharelatex")
Settings = require("settings-sharelatex")
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 Settings.internal?.clsi?.port, "localhost", (error) =>
throw error if error?
@running = true
logger.log("clsi running in dev mode")
for callback in @callbacks
callback()