From 17bd1016910780cafbab463c669ea70fbd49d8ef Mon Sep 17 00:00:00 2001 From: Ryan Graham Date: Thu, 31 Dec 2015 16:52:31 -0800 Subject: [PATCH] ensure app is booted before integration tests --- test/access-control.integration.js | 6 ++++++ test/relations.integration.js | 6 ++++++ test/remoting.integration.js | 6 ++++++ test/user.integration.js | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/test/access-control.integration.js b/test/access-control.integration.js index 3125a653..7e417bfe 100644 --- a/test/access-control.integration.js +++ b/test/access-control.integration.js @@ -11,6 +11,12 @@ var CURRENT_USER = {email: 'current@test.test', password: 'test'}; var debug = require('debug')('loopback:test:access-control.integration'); describe('access control - integration', function() { + before(function(done) { + if (app.booting) { + return app.once('booted', done); + } + done(); + }); lt.beforeEach.withApp(app); diff --git a/test/relations.integration.js b/test/relations.integration.js index 70f1ae12..5257338b 100644 --- a/test/relations.integration.js +++ b/test/relations.integration.js @@ -11,6 +11,12 @@ var debug = require('debug')('loopback:test:relations.integration'); var async = require('async'); describe('relations - integration', function() { + before(function(done) { + if (app.booting) { + return app.once('booted', done); + } + done(); + }); lt.beforeEach.withApp(app); diff --git a/test/remoting.integration.js b/test/remoting.integration.js index c3288d79..b2b92cd8 100644 --- a/test/remoting.integration.js +++ b/test/remoting.integration.js @@ -6,6 +6,12 @@ var app = require(path.join(SIMPLE_APP, 'server/server.js')); var assert = require('assert'); describe('remoting - integration', function() { + before(function(done) { + if (app.booting) { + return app.once('booted', done); + } + done(); + }); lt.beforeEach.withApp(app); lt.beforeEach.givenModel('store'); diff --git a/test/user.integration.js b/test/user.integration.js index b2a92537..fd4a198b 100644 --- a/test/user.integration.js +++ b/test/user.integration.js @@ -7,6 +7,12 @@ var app = require(path.join(SIMPLE_APP, 'server/server.js')); var expect = require('chai').expect; describe('users - integration', function() { + before(function(done) { + if (app.booting) { + return app.once('booted', done); + } + done(); + }); lt.beforeEach.withApp(app);