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

chore: integrate libp2p new pubsub routing #503

Merged
merged 1 commit into from
Aug 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SPEC/PUBSUB.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 2 additions & 8 deletions src/pubsub/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down