Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit acafbd1

Browse files
vasco-santosAlan Shaw
authored and
Alan Shaw
committed
chore: integrate libp2p new pubsub routing (#503)
1 parent cba8b4c commit acafbd1

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

SPEC/PUBSUB.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ A great source of [examples][] can be found in the tests for this API.
106106
##### `ipfs.pubsub.publish(topic, data, [callback])`
107107

108108
- `topic: String`
109-
- `data: Buffer` - The message to send
109+
- `data: Buffer|String` - The message to send
110110
- `callback: (Error) => {}` - (Optional) Calls back with an error or nothing if the publish was successful.
111111

112112
If no `callback` is passed, a promise is returned.

src/pubsub/publish.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,9 @@ module.exports = (createCommon, options) => {
3232

3333
after((done) => common.teardown(done))
3434

35-
it('should error on string messags', async () => {
35+
it('should publish message from string', () => {
3636
const topic = getTopic()
37-
try {
38-
await ipfs.pubsub.publish(topic, 'hello friend')
39-
} catch (err) {
40-
expect(err).to.exist()
41-
return
42-
}
43-
throw new Error('did not error on string message')
37+
return ipfs.pubsub.publish(topic, 'hello friend')
4438
})
4539

4640
it('should publish message from buffer', () => {

0 commit comments

Comments
 (0)