fix(ipfs-coord): Increased unit test coverage to 100%

This commit is contained in:
Chris Troutner
2022-06-20 07:01:43 -07:00
parent 62a7fcb16d
commit d0efdcfa07
2 changed files with 21 additions and 10 deletions
+5 -10
View File
@@ -100,16 +100,11 @@ class IpfsCoordAdapter {
// Subscribe to the chat pubsub channel
async subscribeToChat () {
try {
await this.ipfsCoord.adapters.pubsub.subscribeToPubsubChannel(
this.config.chatPubSubChan,
console.log,
this.ipfsCoord.thisNode
)
} catch (err) {
console.error('Error in subscribeToChat')
throw err
}
await this.ipfsCoord.adapters.pubsub.subscribeToPubsubChannel(
this.config.chatPubSubChan,
console.log,
this.ipfsCoord.thisNode
)
}
}
@@ -112,4 +112,20 @@ describe('#IPFS', () => {
}
})
})
describe('#subscribeToChat', () => {
it('should subscribe to the chat channel', async () => {
// Mock dependencies
uut.ipfsCoord = {
adapters: {
pubsub: {
subscribeToPubsubChannel: async () => {
}
}
}
}
await uut.subscribeToChat()
})
})
})