mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
[misc] wait for the mongo connection before starting acceptance tests
This commit is contained in:
parent
84406fd947
commit
1b70189fb1
1 changed files with 6 additions and 4 deletions
|
@ -11,6 +11,7 @@
|
|||
* DS207: Consider shorter variations of null checks
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
const { waitForDb } = require('../../../../app/js/mongodb')
|
||||
const app = require('../../../../app')
|
||||
|
||||
module.exports = {
|
||||
|
@ -25,9 +26,10 @@ module.exports = {
|
|||
return callback()
|
||||
} else if (this.initing) {
|
||||
return this.callbacks.push(callback)
|
||||
} else {
|
||||
this.initing = true
|
||||
this.callbacks.push(callback)
|
||||
}
|
||||
this.initing = true
|
||||
this.callbacks.push(callback)
|
||||
waitForDb().then(() => {
|
||||
return app.listen(3010, 'localhost', (error) => {
|
||||
if (error != null) {
|
||||
throw error
|
||||
|
@ -41,6 +43,6 @@ module.exports = {
|
|||
return result
|
||||
})()
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue