From a382f62071f652237bd711af3f0e2a9758dea90a Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 17 Jan 2017 10:39:28 +0900 Subject: [PATCH] [WIP] test --- test/api.js | 7 +++++++ test/index.js | 3 --- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/test/api.js b/test/api.js index 32052fe5a8..e9ec076ee0 100644 --- a/test/api.js +++ b/test/api.js @@ -2,6 +2,9 @@ * API TESTS */ +// During the test the env variable is set to test +process.env.NODE_ENV = 'test'; + const chai = require('chai'); const chaiHttp = require('chai-http'); const should = chai.should(); @@ -9,8 +12,12 @@ const should = chai.should(); chai.use(chaiHttp); const server = require('../built/api/server'); +const db = require('../built/db/mongodb').default; describe('API', () => { + // Reset database + db.get('users').drop(); + it('greet server', done => { chai.request(server) .get('/') diff --git a/test/index.js b/test/index.js index 6444fea62c..46e98f4ec1 100644 --- a/test/index.js +++ b/test/index.js @@ -1,6 +1,3 @@ -// During the test the env variable is set to test -process.env.NODE_ENV = 'test'; - // Init babel require('babel-core/register'); require('babel-polyfill');