diff --git a/SPEC/PUBSUB.md b/SPEC/PUBSUB.md index b8977ff7..ecc6d96b 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 ef219129..105be564 100644 --- a/src/pubsub/publish.js +++ b/src/pubsub/publish.js @@ -32,15 +32,10 @@ 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', () => {