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

Commit ad0e273

Browse files
author
Alan Shaw
committed
fix: only expect local addrs in Node.js
1 parent d7d3a41 commit ad0e273

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/swarm/disconnect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = (common, options) => {
2020

2121
before(async () => {
2222
ipfsA = (await common.spawn()).api
23-
ipfsB = (await common.spawn()).api
23+
ipfsB = (await common.spawn({ type: 'js' })).api
2424
await ipfsA.swarm.connect(ipfsB.peerId.addresses[0])
2525
})
2626

src/swarm/local-addrs.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* eslint-env mocha */
22
'use strict'
33

4+
const { isNode } = require('ipfs-utils/src/env')
45
const { getDescribe, getIt, expect } = require('../utils/mocha')
56

67
/** @typedef { import("ipfsd-ctl/src/factory") } Factory */
@@ -25,7 +26,11 @@ module.exports = (common, options) => {
2526

2627
it('should list local addresses the node is listening on', async () => {
2728
const multiaddrs = await ipfs.swarm.localAddrs()
28-
expect(multiaddrs).to.have.length.above(0)
29+
if (isNode) {
30+
expect(multiaddrs).to.have.length.above(0)
31+
} else {
32+
expect(multiaddrs).to.have.length(0)
33+
}
2934
})
3035
})
3136
}

0 commit comments

Comments
 (0)