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

View File

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

View File

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

View File

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