From 95bf609512c072a3d07d3b5db353f6252d43c7d3 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 32052fe5a..e9ec076ee 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 6444fea62..46e98f4ec 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');