Skip to content

Commit accce99

Browse files
committed
Update test
1 parent 80f8986 commit accce99

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/client.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,16 +301,18 @@ test('ws: client.announce() with params', function (t) {
301301
})
302302

303303
function testClientGetAnnounceOpts (t, serverType) {
304-
t.plan(5)
304+
t.plan(7)
305305

306306
common.createServer(t, serverType, function (server, announceUrl) {
307307
var client = new Client({
308308
infoHash: fixtures.leaves.parsedTorrent.infoHash,
309309
announce: announceUrl,
310310
peerId: peerId1,
311311
port: port,
312-
getAnnounceOpts: function () {
312+
getAnnounceOpts: function (opts) {
313313
return {
314+
infoHash: this.infoHash,
315+
optsDL: opts.downloaded,
314316
testParam: 'this is a test'
315317
}
316318
},
@@ -319,6 +321,8 @@ function testClientGetAnnounceOpts (t, serverType) {
319321

320322
server.on('start', function (peer, params) {
321323
t.equal(params.testParam, 'this is a test')
324+
t.equal(params.infoHash, fixtures.leaves.parsedTorrent.infoHash)
325+
t.equal(params.optsDL, params.downloaded)
322326
})
323327

324328
if (serverType === 'ws') common.mockWebsocketTracker(client)

0 commit comments

Comments
 (0)