@@ -37,6 +37,7 @@ sequelize
app.listen(config.port, () => {
console.log('Listening on ' + config.port)
+ app.locals.appStarted = true
app.emit('appStarted')
})
@@ -14,6 +14,8 @@ chai.use(require('chai-things'))
describe('AdminToken', () => {
//Wait for app to start before commencing
before((done) => {
+ if(server.locals.appStarted) done()
+
server.on('appStarted', () => {
done()
describe('Category', () => {
describe('User', () => {