From 7375d8d4ec0f125b41638802d833e4543e3287ae Mon Sep 17 00:00:00 2001 From: Vasco Santos Date: Tue, 23 Jul 2019 11:48:53 +0200 Subject: [PATCH] chore: integrate libp2p new pubsub routing --- SPEC/PUBSUB.md | 2 +- src/pubsub/publish.js | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/SPEC/PUBSUB.md b/SPEC/PUBSUB.md index b8977ff72..ecc6d96bb 100644 --- a/SPEC/PUBSUB.md +++ b/SPEC/PUBSUB.md @@ -106,7 +106,7 @@ A great source of [examples][] can be found in the tests for this API. ##### `ipfs.pubsub.publish(topic, data, [callback])` - `topic: String` -- `data: Buffer` - The message to send +- `data: Buffer|String` - The message to send - `callback: (Error) => {}` - (Optional) Calls back with an error or nothing if the publish was successful. If no `callback` is passed, a promise is returned. diff --git a/src/pubsub/publish.js b/src/pubsub/publish.js index ef219129a..8c660c675 100644 --- a/src/pubsub/publish.js +++ b/src/pubsub/publish.js @@ -32,15 +32,9 @@ module.exports = (createCommon, options) => { after((done) => common.teardown(done)) - it('should error on string messags', async () => { + it('should publish message from string', () => { const topic = getTopic() - try { - await ipfs.pubsub.publish(topic, 'hello friend') - } catch (err) { - expect(err).to.exist() - return - } - throw new Error('did not error on string message') + return ipfs.pubsub.publish(topic, 'hello friend') }) it('should publish message from buffer', () => {