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

Commit ac7cedf

Browse files
committed
fix: fix swarm peer tests for electron
1 parent 0fd52d3 commit ac7cedf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/swarm/peers.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
const multiaddr = require('multiaddr')
55
const CID = require('cids')
66
const delay = require('delay')
7-
const { isNode, isBrowser } = require('ipfs-utils/src/env')
7+
const { isNode, isBrowser, isElectron } = require('ipfs-utils/src/env')
88
const { getDescribe, getIt, expect } = require('../utils/mocha')
99

1010
/** @typedef { import("ipfsd-ctl/src/factory") } Factory */
@@ -99,14 +99,14 @@ module.exports = (common, options) => {
9999

100100
it('should list peers only once even if they have multiple addresses', async () => {
101101
// TODO: Change to port 0, needs: https://github.com/ipfs/interface-ipfs-core/issues/152
102-
const configA = getConfig(isNode || (common.opts && common.opts.type === 'go') ? [
102+
const configA = getConfig(isNode || isElectron || (common.opts && common.opts.type === 'go') ? [
103103
'/ip4/127.0.0.1/tcp/16543',
104104
'/ip4/127.0.0.1/tcp/16544'
105105
] : [
106106
'/ip4/127.0.0.1/tcp/14578/ws/p2p-webrtc-star',
107107
'/ip4/127.0.0.1/tcp/14579/ws/p2p-webrtc-star'
108108
])
109-
const configB = getConfig(isNode || (common.opts && common.opts.type === 'go') ? [
109+
const configB = getConfig(isNode || isElectron || (common.opts && common.opts.type === 'go') ? [
110110
'/ip4/127.0.0.1/tcp/26545/ws',
111111
'/ip4/127.0.0.1/tcp/26546/ws'
112112
] : [

0 commit comments

Comments
 (0)