Skip to content

Commit 76ea075

Browse files
jacobheunvmx
authored andcommitted
test: fix test usage for latest switch
1 parent b5d69f2 commit 76ea075

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

test/network/gen-bitswap-network.node.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,11 @@ describe('gen Bitswap network', function () {
7474
Object.keys(node.libp2p._switch.conns)
7575
).to.be.empty()
7676

77+
// Parallel dials may result in 1 or 2 connections
78+
// depending on when they're executed.
7779
expect(
78-
Object.keys(node.libp2p._switch.muxedConns)
79-
).to.have.length(n - 1)
80+
Object.keys(node.libp2p._switch.connection.getAll())
81+
).to.have.a.lengthOf.at.least(n - 1)
8082
})
8183

8284
// -- actual test

test/utils/mocks.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ exports.mockLibp2pNode = () => {
3939
setImmediate(() => callback())
4040
},
4141
swarm: {
42-
muxedConns: {},
4342
setMaxListeners () {}
4443
},
4544
peerBook: new PeerBook()

0 commit comments

Comments
 (0)