Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Commit 6821a5d

Browse files
authored
fix: tests for new IPNS name formatting (#141)
* test: update tests for new IPNS key format * style: fix * fix: package.json * fix: package.json * fix: test updates
1 parent 80652b2 commit 6821a5d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"mocha": "^8.0.1",
5252
"multihashes": "^1.0.1",
5353
"nanoid": "^3.1.10",
54+
"peer-id": "^0.13.13",
5455
"p-retry": "^4.1.0",
5556
"pretty-bytes": "^5.1.0",
5657
"promisify-es6": "^1.0.3",

test/ipns-pubsub.js

Lines changed: 2 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 PeerID = require('peer-id')
45
const { fromB58String } = require('multihashes')
56
const base64url = require('base64url')
67
const ipns = require('ipns')
@@ -110,7 +111,7 @@ const subscribeToReceiveByPubsub = async (nodeA, nodeB, idA, idB) => {
110111
await waitFor(() => subscribed === true, (50 * 1000))
111112
const res2 = await last(nodeB.api.name.resolve(idA))
112113

113-
expect(res1.name).to.equal(idA) // Published to Node A ID
114+
expect(PeerID.createFromCID(res1.name).toString()).to.equal(PeerID.createFromB58String(idA).toString()) // Published to Node A ID
114115
expect(res2).to.equal(ipfsRef)
115116
}
116117

0 commit comments

Comments
 (0)