From 237ac7731c2645cbf8cefc1f01b0f03f2be9491f Mon Sep 17 00:00:00 2001 From: ivaosthu Date: Sat, 5 Nov 2016 15:28:33 +0100 Subject: [PATCH] Try to migrate database when running e2e tests --- packages/unleash-api/test/e2e/test-helper.js | 6 +++++- packages/unleash-demo-app/package.json | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/unleash-api/test/e2e/test-helper.js b/packages/unleash-api/test/e2e/test-helper.js index eec6f82239..f38ee0c145 100644 --- a/packages/unleash-api/test/e2e/test-helper.js +++ b/packages/unleash-api/test/e2e/test-helper.js @@ -2,8 +2,12 @@ process.env.NODE_ENV = 'test'; +// Mute migrator +require('db-migrate-shared').log.silence(true); + const BPromise = require('bluebird'); let request = require('supertest'); +const migrator = require('../../migrator'); const options = { databaseUri: require('./database-config').getDatabaseUri(), @@ -115,7 +119,7 @@ function resetDatabase () { } function setupDatabase () { - return BPromise.all([createStrategies(), createFeatures()]); + return BPromise.all([migrator(options.databaseUri), createStrategies(), createFeatures()]); } module.exports = { diff --git a/packages/unleash-demo-app/package.json b/packages/unleash-demo-app/package.json index 4b34e29792..e6258d6057 100644 --- a/packages/unleash-demo-app/package.json +++ b/packages/unleash-demo-app/package.json @@ -4,7 +4,8 @@ "description": "", "main": "src/index.js", "scripts": { - "start": "node ." + "start": "node .", + "test:ci": "echo 'success'" }, "dependencies": { "express": "^4.14.0",