Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 82b0e90

Browse files
committed
test: fix pubsub peers test, now pubsub returns the list of peers even when no topic is provided
1 parent 8fe810d commit 82b0e90

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

src/http/api/resources/pubsub.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ exports.subscribe = {
1818

1919
const ipfs = request.server.app.ipfs
2020

21-
const res = new PassThrough({highWaterMark: 1})
21+
const res = new PassThrough({ highWaterMark: 1 })
2222

2323
const handler = (msg) => {
2424
res.write(JSON.stringify({
@@ -89,7 +89,7 @@ exports.ls = {
8989
return reply(new Error(`Failed to list subscriptions: ${err}`))
9090
}
9191

92-
reply({Strings: subscriptions})
92+
reply({ Strings: subscriptions })
9393
})
9494
}
9595
}
@@ -108,7 +108,7 @@ exports.peers = {
108108
return reply(new Error(message))
109109
}
110110

111-
reply({Strings: peers})
111+
reply({ Strings: peers })
112112
})
113113
}
114114
}

test/http-api/inject/pubsub.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,6 @@ module.exports = (http) => {
9191
})
9292

9393
describe('/peers', () => {
94-
it('returns 200 if no topic is provided', (done) => {
95-
api.inject({
96-
method: 'GET',
97-
url: `/api/v0/pubsub/peers`
98-
}, (res) => {
99-
expect(res.statusCode).to.equal(200)
100-
expect(res.result.Strings).to.be.eql([])
101-
done()
102-
})
103-
})
104-
10594
it('returns 200 if not subscribed to a topic', (done) => {
10695
api.inject({
10796
method: 'GET',

0 commit comments

Comments
 (0)