From c374b7f9cb617e1a6e9332fb4fb6c0b930fbb2d5 Mon Sep 17 00:00:00 2001 From: Vasco Santos Date: Sat, 29 Sep 2018 22:21:13 +0100 Subject: [PATCH] chore: update js-ipfs version --- package.json | 2 +- test/ipns.js | 4 ++-- test/node.js | 2 +- test/repo.js | 30 +++++++++++++++++++----------- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 35212ddd..63e2a253 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "form-data": "^2.3.2", "go-ipfs-dep": "~0.4.17", "hat": "0.0.3", - "ipfs": "~0.32.0", + "ipfs": "~0.32.3", "ipfs-api": "^24.0.0", "ipfsd-ctl": "~0.39.1", "ipfs-unixfs": "~0.1.15", diff --git a/test/ipns.js b/test/ipns.js index e2d78b69..56bdf9d7 100644 --- a/test/ipns.js +++ b/test/ipns.js @@ -45,7 +45,7 @@ const publishAndResolve = (publisherDaemon, resolverDaemon, callback) => { sameDaemon = true } - const stopAndStartSecondDaemon = (callback) => { + const stopPublisherAndStartResolverDaemon = (callback) => { if (sameDaemon) { return callback() } @@ -65,7 +65,7 @@ const publishAndResolve = (publisherDaemon, resolverDaemon, callback) => { cb() }), (cb) => publisherDaemon.api.name.publish(ipfsRef, { resolve: false }, cb), - (cb) => stopAndStartSecondDaemon(cb), + (cb) => stopPublisherAndStartResolverDaemon(cb), (cb) => { resolverDaemon.api.name.resolve(nodeId, { local: true }, (err, res) => { expect(err).to.not.exist() diff --git a/test/node.js b/test/node.js index 3c613449..2d4fbbe0 100644 --- a/test/node.js +++ b/test/node.js @@ -5,7 +5,7 @@ require('./pubsub') require('./circuit') require('./repo') require('./exchange-files') +require('./ipns') require('./kad-dht') require('./pin') require('./files') -require('./ipns') diff --git a/test/repo.js b/test/repo.js index d267412e..47123203 100644 --- a/test/repo.js +++ b/test/repo.js @@ -77,7 +77,7 @@ describe('repo', () => { }) it('read repo: js -> go', function (done) { - this.timeout(50 * 1000) + this.timeout(80 * 1000) const dir = path.join(os.tmpdir(), hat()) const data = crypto.randomBytes(1024 * 5) @@ -88,26 +88,34 @@ describe('repo', () => { series([ (cb) => jsDf.spawn({ repoPath: dir, + disposable: false, initOptions: { bits: 512 } - }, cb), - (node, cb) => { + }, (err, node) => { + expect(err).to.not.exist() + jsDaemon = node - cb() - }, - (cb) => jsDaemon.api.add(data, cb), - (res, cb) => { + jsDaemon.init(cb) + }), + (cb) => jsDaemon.start(cb), + + (cb) => jsDaemon.api.add(data, (err, res) => { + expect(err).to.not.exist() + hash = res[0].hash catAndCheck(jsDaemon.api, hash, data, cb) - }, + }), (cb) => jsDaemon.stop(cb), (cb) => goDf.spawn({ repoPath: dir, + disposable: false, initOptions: { bits: 1024 } - }, cb), - (node, cb) => { + }, (err, node) => { + expect(err).to.not.exist() + goDaemon = node cb() - }, + }), + (cb) => goDaemon.start(cb), (cb) => catAndCheck(goDaemon.api, hash, data, cb), (cb) => goDaemon.stop(cb) ], done)