Cleanup app/init/koa-middlewares

This commit is contained in:
Tankred Hase
2017-08-17 19:16:49 +08:00
parent 8c76281666
commit 95ff2d9247
8 changed files with 178 additions and 151 deletions

View File

@@ -1,5 +1,6 @@
'use strict';
const log = require('npmlog');
const config = require('config');
const Mongo = require('../../src/dao/mongo');
@@ -7,9 +8,13 @@ describe('Mongo Integration Tests', function() {
this.timeout(20000);
const DB_TYPE = 'apple';
let sandbox;
let mongo;
before(async () => {
sandbox = sinon.sandbox.create();
sandbox.stub(log);
mongo = new Mongo();
await mongo.init(config.mongo);
});
@@ -19,6 +24,7 @@ describe('Mongo Integration Tests', function() {
});
after(async () => {
sandbox.restore();
await mongo.clear(DB_TYPE);
await mongo.disconnect();
});