Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 70f195b

Browse files
haadcodedaviddias
authored andcommitted
Enable peer listing tests (#117)
1 parent 2b6cb0b commit 70f195b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/pubsub.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,17 +214,19 @@ module.exports = (common) => {
214214
})
215215
})
216216

217-
it.skip("doesn't return extra peers", (done) => {
217+
it("doesn't return extra peers", (done) => {
218218
// Currently go-ipfs returns peers that have not been
219219
// subscribed to the topic. Enable when go-ipfs has been fixed
220220
const sub1 = (msg) => {}
221221
const sub2 = (msg) => {}
222+
const sub3 = (msg) => {}
222223

223224
const topicOther = topic + 'different topic'
224225

225226
series([
226227
(cb) => ipfs1.pubsub.subscribe(topic, sub1, cb),
227-
(cb) => ipfs2.pubsub.subscribe(topicOther, sub2, cb)
228+
(cb) => ipfs2.pubsub.subscribe(topicOther, sub2, cb),
229+
(cb) => ipfs3.pubsub.subscribe(topicOther, sub3, cb)
228230
], (err) => {
229231
expect(err).to.not.exist
230232
setTimeout(() => {
@@ -234,26 +236,30 @@ module.exports = (common) => {
234236
expect(peers).to.be.empty
235237
ipfs1.pubsub.unsubscribe(topic, sub1)
236238
ipfs2.pubsub.unsubscribe(topicOther, sub2)
239+
ipfs3.pubsub.unsubscribe(topicOther, sub3)
237240
done()
238241
}, 10000)
239242
})
240243
})
241244
})
242245

243-
it.skip('returns peers for a topic - one peer', (done) => {
246+
it('returns peers for a topic - one peer', (done) => {
244247
// Currently go-ipfs returns peers that have not been
245248
// subscribed to the topic. Enable when go-ipfs has been fixed
246249
const sub1 = (msg) => {}
247250
const sub2 = (msg) => {}
251+
const sub3 = (msg) => {}
248252

249253
series([
250254
(cb) => ipfs1.pubsub.subscribe(topic, sub1, cb),
251255
(cb) => ipfs2.pubsub.subscribe(topic, sub2, cb),
256+
(cb) => ipfs3.pubsub.subscribe(topic, sub3, cb),
252257
(cb) => waitForPeers(ipfs1, topic, [ipfs2.peerId.id], cb)
253258
], (err) => {
254259
expect(err).to.not.exist
255260
ipfs1.pubsub.unsubscribe(topic, sub1)
256261
ipfs2.pubsub.unsubscribe(topic, sub2)
262+
ipfs3.pubsub.unsubscribe(topic, sub3)
257263

258264
done()
259265
})

0 commit comments

Comments
 (0)