1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 1× 1× 1× 1× 1× 1× 1× 1× 3× 3× | 'use strict' let Bluebird = require('bluebird') let config = require('./config') // use a test db instead of the real one let dbUrl = config.get('DB_URI') + '-test' config.set('DB_URI', dbUrl) config.set('DEBUG', false) config.set('ENV', 'test') exports.app = require('./app') // Drop a collection exports.dropCollection = function (Model) { Iif (config.get('ENV') !== 'test') return Bluebird.reject() return Model.remove({}) } |