From c317204c74ff7242e2b2336a942d658e58cf83ca 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/helpers/loopback-testing-helper.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/helpers/loopback-testing-helper.js b/test/helpers/loopback-testing-helper.js index ac88f28d..c5069050 100644 --- a/test/helpers/loopback-testing-helper.js +++ b/test/helpers/loopback-testing-helper.js @@ -18,13 +18,18 @@ _beforeEach.withApp = function(app) { app.models.User.settings.saltWorkFactor = 4; } - beforeEach(function() { + beforeEach(function(done) { this.app = app; var _request = this.request = request(app); this.post = _request.post; this.get = _request.get; this.put = _request.put; this.del = _request.del; + + if (app.booting) { + return app.once('booted', done); + } + done(); }); };