Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' into greenkeeper/initial
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe Braud committed Jan 4, 2018
2 parents 8905ac0 + eef5688 commit 794d65e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"url": "git://github.com/campsi/campsi-service-assets.git"
},
"dependencies": {
"async": "^2.4.1",
"async": "^2.6.0",
"aws-sdk": "^2.150.0",
"debug": "^3.1.0",
"for-in": "^1.0.2",
"mkdirp": "^0.5.1",
"multer": "2.0.0-alpha.6",
"multer": "^2.0.0-alpha.6",
"string-format": "^0.5.0",
"unique-slug": "^2.0.0"
},
Expand Down Expand Up @@ -46,7 +46,7 @@
}
},
"scripts": {
"cover": "istanbul cover _mocha \"./test/**/!(index).js\" -- --exit",
"cover": "istanbul --include-all-sources cover _mocha \"./test/**/!(index).js\" -- --exit",
"coveralls": "npm run cover -- --report lcovonly && cat ./coverage/lcov.info | coveralls",
"depcheck": "depcheck --ignores=path,mocha-lcov-reporter",
"lint": "./node_modules/eslint/bin/eslint.js --cache lib/** test/**",
Expand Down
8 changes: 5 additions & 3 deletions test/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const chai = require('chai');
const chaiHttp = require('chai-http');
const CampsiServer = require('campsi');
const config = require('config');
const {MongoClient} = require('mongodb');
const {MongoClient, Server} = require('mongodb');
const fs = require('fs');
const path = require('path');
const uniqueSlug = require('unique-slug');
Expand Down Expand Up @@ -90,9 +90,11 @@ describe('Assets API', () => {
beforeEach((done) => {

// Empty the database
MongoClient.connect(config.campsi.mongoURI).then((db) => {
let client = new MongoClient(new Server(config.campsi.mongo.host, config.campsi.mongo.port));
client.connect((error, mongoClient) => {
let db = mongoClient.db(config.campsi.mongo.name);
db.dropDatabase(() => {
db.close();
client.close();
campsi = new CampsiServer(config.campsi);
campsi.mount('assets', new services.Assets(config.services.assets));

Expand Down
5 changes: 5 additions & 0 deletions test/config/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ module.exports = {
title: 'Test Assets',
campsi: {
mongoURI: 'mongodb://localhost:27017/relationships',
mongo: {
host: 'localhost',
port: 27017,
name: 'relationships'
}
},
services: {
assets: {
Expand Down
5 changes: 2 additions & 3 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ process.on('uncaughtException', function () {
debug('uncaughtException');
});

process.on('unhandledRejection', (reason) => {
debug('unhandledRejection');
debug(reason);
process.on('unhandledRejection', (reason, p) => {
debug('Unhandled Rejection at:', p, 'reason:', reason);
process.exit(1);
});

Expand Down

0 comments on commit 794d65e

Please sign in to comment.