Remove bluebird dependency, fix tests

This commit is contained in:
haad 2016-04-13 10:38:27 +02:00
parent da55984081
commit 393391a1fd
4 changed files with 10 additions and 12 deletions

View File

@ -13,9 +13,8 @@
},
"main": "src/Client.js",
"dependencies": {
"ipfs-log": "^1.1.4",
"ipfs-log": "^1.1.5",
"lazy.js": "^0.4.2",
"lodash": "^4.3.0",
"log4js": "^0.6.33",
"orbit-common": "^0.2.4",
"socket.io-client": "^1.4.5"
@ -23,6 +22,7 @@
"devDependencies": {
"asyncawait": "^1.0.1",
"eslint": "^2.3.0",
"lodash": "^4.3.0",
"mocha": "^2.3.4"
},
"scripts": {

View File

@ -2,7 +2,6 @@
const Lazy = require('lazy.js');
const EventEmitter = require('events').EventEmitter;
const Promise = require('bluebird');
const logger = require('orbit-common/lib/logger')("orbit-db.OrbitDB");
const Log = require('ipfs-log');
const DBOperation = require('./db/Operation');
@ -139,12 +138,11 @@ class OrbitDB {
.map((f) => f.payload)
.filter((f) => Lazy(this._cached).find((e) => e.hash === f.payload) === undefined);
Promise.map(payloadHashes, (f) => OrbitDB.fetchPayload(this._ipfs, f), { concurrency: 4 })
.then((payloads) => {
payloads.forEach((f) => this._cached.push(f));
resolve();
})
.catch(reject);
const promises = payloadHashes.map((f) => OrbitDB.fetchPayload(this._ipfs, f));
Promise.all(promises).then((payloads) => {
payloads.forEach((f) => this._cached.push(f));
resolve();
}).catch(reject);
});
}

View File

@ -15,7 +15,7 @@ const username = 'testrunner';
const password = '';
describe('Orbit Client', function() {
this.timeout(2000);
this.timeout(20000);
let client, db;
let channel = 'abcdefgh';

View File

@ -11,7 +11,7 @@ const OrbitDB = require('../src/OrbitDB');
const Log = require('ipfs-log');
// Mute logging
// require('log4js').setGlobalLogLevel('ERROR');
require('log4js').setGlobalLogLevel('ERROR');
// Orbit
const username = 'testrunner';
@ -19,7 +19,7 @@ const password = '';
const user = { username: username };
describe('OrbitDB', function() {
this.timeout(2000);
this.timeout(20000);
let db, ipfs;
let channel = 'orbit-db.test';