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

Commit 1824f9d

Browse files
committed
fix: fix ping test
1 parent 682a2da commit 1824f9d

File tree

1 file changed

+7
-2
lines changed
  • packages/interface-ipfs-core/src/ping

1 file changed

+7
-2
lines changed

packages/interface-ipfs-core/src/ping/ping.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,16 @@ module.exports = (common, options) => {
4949
expect(pongs.length).to.equal(count)
5050
})
5151

52-
it('should fail when pinging a peer that is not available', () => {
52+
it('should fail when pinging a peer that is not available', async () => {
5353
const notAvailablePeerId = 'QmUmaEnH1uMmvckMZbh3yShaasvELPW4ZLPWnB4entMTEn'
5454
const count = 2
5555

56-
return expect(all(ipfsA.ping(notAvailablePeerId, { count }))).to.eventually.be.rejected()
56+
try {
57+
await all(ipfsA.ping(notAvailablePeerId, { count }))
58+
throw new Error('Should throw')
59+
} catch (error) {
60+
expect(error.message).to.not.eq('Should throw')
61+
}
5762
})
5863

5964
it('should fail when pinging an invalid peer Id', () => {

0 commit comments

Comments
 (0)