Cleanup and fix tests

This commit is contained in:
haad 2016-03-12 10:55:59 +01:00
parent a4dc49b83b
commit a54ef8c337
3 changed files with 9 additions and 5 deletions

View File

@ -34,9 +34,9 @@ class Client {
del: (key) => this.db.del(channel, password, key),
add: (data) => this.db.add(channel, password, data),
put: (key, data) => this.db.put(channel, password, key, data),
get: (key, options) => {
get: (key) => {
const items = this._iterator(channel, password, { key: key }).collect();
return items[0] ? items[0] : null; // TODO: use KeyValuePost, currently .content is from TextPost
return items[0] ? items[0] : null;
},
close: () => this._pubsub.unsubscribe(channel)
}

View File

@ -13,7 +13,7 @@ const username = 'testrunner';
const password = '';
describe('Orbit Client', function() {
this.timeout(5000);
this.timeout(15000);
let client, db;
let items = [];

View File

@ -20,10 +20,14 @@ const startIpfs = async (() => {
let ipfs;
describe('OrbitList', async(function() {
this.timeout(5000);
this.timeout(15000);
before(async((done) => {
ipfs = await(startIpfs());
try {
ipfs = await(startIpfs());
} catch(e) {
assert.equals(e, null);
}
done();
}));