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

Commit e427e91

Browse files
committedOct 25, 2015
fix swarm.connect and swarm.peers tests
1 parent bc72e36 commit e427e91

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed
 

‎test/tests.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,13 @@ describe('IPFS Node.js API wrapper tests', function () {
4444
if (err) {
4545
throw err
4646
}
47-
addrs[key] = apiAddrs[key] + '/ipfs/' + id.ID
47+
addrs[key] = id.Addresses[0] // apiAddrs[key] + '/ipfs/' + id.ID
4848
cb()
4949
})
5050
}
5151

5252
function dial () {
53-
console.log(addrs)
5453
apiClients['a'].swarm.connect(addrs['b'], function (err, res) {
55-
console.log('->', res)
5654
if (err) {
5755
throw err
5856
}
@@ -399,14 +397,13 @@ describe('IPFS Node.js API wrapper tests', function () {
399397
})
400398

401399
describe('.swarm', function () {
402-
it.skip('.swarm.peers', function (done) {
400+
it('.swarm.peers', function (done) {
403401
apiClients['a'].swarm.peers(function (err, res) {
404402
if (err) {
405403
throw err
406404
}
407405

408-
console.log('should have 2 nodes', res)
409-
assert(res.length >= 2)
406+
assert(res.Strings.length >= 2)
410407
done()
411408
})
412409
})
@@ -501,7 +498,9 @@ describe('IPFS Node.js API wrapper tests', function () {
501498
}
502499

503500
apiClients['a'].dht.get('scope', function (err, value) {
504-
if (err) console.error(err)
501+
if (err) {
502+
throw err
503+
}
505504
assert.equal(value, 'interplanetary')
506505
done()
507506
})

‎test/tmp-disposable-nodes-addrs.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"a":"/ip4/127.0.0.1/tcp/56689","b":"/ip4/127.0.0.1/tcp/56694","c":"/ip4/127.0.0.1/tcp/56697"}
1+
{"a":"/ip4/127.0.0.1/tcp/57144","b":"/ip4/127.0.0.1/tcp/57167","c":"/ip4/127.0.0.1/tcp/57172"}

0 commit comments

Comments
 (0)
This repository has been archived.