Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 71e5f53

Browse files
authored
chore: fix flaky test (#3680)
Because the requests are initiated with `Promise.all`, there's no guarantee which order they arrive at the server in so when we check the responses, just make sure the length and contents are correct instead of the order.
1 parent efd147a commit 71e5f53

File tree

1 file changed

+7
-5
lines changed
  • packages/ipfs-http-client/test/node

1 file changed

+7
-5
lines changed

packages/ipfs-http-client/test/node/agent.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,16 @@ describe('agent', function () {
102102
}
103103

104104
const results = await requests
105-
106-
expect(results).to.deep.equal([{
105+
expect(results).to.have.lengthOf(3)
106+
expect(results).to.deep.include({
107107
res: 0
108-
}, {
108+
})
109+
expect(results).to.deep.include({
109110
res: 1
110-
}, {
111+
})
112+
expect(results).to.deep.include({
111113
res: 2
112-
}])
114+
})
113115

114116
server.close()
115117
})

0 commit comments

Comments
 (0)