mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-29 23:00:08 +02:00

* [misc] silence logger when running tests * [misc] re-enable logging in some tests for scripts * [misc] make it easy to turn on verbose logging for tests ``` LOG_LEVEL=debug make test_unit LOG_LEVEL=debug make test_acceptance ``` GitOrigin-RevId: 219bc6d1f9cbdb89ddd7d94742920913ddde4514
26 lines
620 B
JavaScript
26 lines
620 B
JavaScript
const app = require('../../../../app')
|
|
const settings = require('@overleaf/settings')
|
|
|
|
module.exports = {
|
|
running: false,
|
|
initing: false,
|
|
callbacks: [],
|
|
ensureRunning(callback) {
|
|
if (this.running) {
|
|
return callback()
|
|
} else if (this.initing) {
|
|
return this.callbacks.push(callback)
|
|
}
|
|
this.initing = true
|
|
this.callbacks.push(callback)
|
|
app.listen(settings.internal.docstore.port, '127.0.0.1', error => {
|
|
if (error != null) {
|
|
throw error
|
|
}
|
|
this.running = true
|
|
for (callback of Array.from(this.callbacks)) {
|
|
callback()
|
|
}
|
|
})
|
|
},
|
|
}
|