diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/node/blocklist-dht.js | 10 | ||||
-rw-r--r-- | test/node/download-dht-magnet.js | 8 |
2 files changed, 10 insertions, 8 deletions
diff --git a/test/node/blocklist-dht.js b/test/node/blocklist-dht.js index b492057..4ea82b1 100644 --- a/test/node/blocklist-dht.js +++ b/test/node/blocklist-dht.js @@ -6,7 +6,7 @@ var test = require('tape') var WebTorrent = require('../../') test('blocklist blocks peers discovered via DHT', function (t) { - t.plan(9) + t.plan(8) var dhtServer, client1, client2 @@ -21,7 +21,7 @@ test('blocklist blocks peers discovered via DHT', function (t) { function (cb) { client1 = new WebTorrent({ tracker: false, - dht: { bootstrap: '127.0.0.1:' + dhtServer.address().port } + dht: { bootstrap: '127.0.0.1:' + dhtServer.address().port, host: networkAddress.ipv4() } }) client1.on('error', function (err) { t.fail(err) }) client1.on('warning', function (err) { t.fail(err) }) @@ -58,7 +58,7 @@ test('blocklist blocks peers discovered via DHT', function (t) { function (cb) { client2 = new WebTorrent({ tracker: false, - dht: { bootstrap: '127.0.0.1:' + dhtServer.address().port }, + dht: { bootstrap: '127.0.0.1:' + dhtServer.address().port, host: networkAddress.ipv4() }, blocklist: [ '127.0.0.1', networkAddress.ipv4() ] }) client2.on('error', function (err) { t.fail(err) }) @@ -66,8 +66,8 @@ test('blocklist blocks peers discovered via DHT', function (t) { var torrent2 = client2.add(common.leaves.parsedTorrent) - torrent2.on('blockedPeer', function () { - t.pass('client2 blocked connection to client1') + torrent2.on('blockedPeer', function (addr) { + t.pass('client2 blocked connection to client1: ' + addr) }) torrent2.on('dhtAnnounce', function () { diff --git a/test/node/download-dht-magnet.js b/test/node/download-dht-magnet.js index e7a7232..d5849f0 100644 --- a/test/node/download-dht-magnet.js +++ b/test/node/download-dht-magnet.js @@ -1,12 +1,13 @@ var common = require('../common') var DHT = require('bittorrent-dht/server') var fs = require('fs') +var networkAddress = require('network-address') var series = require('run-series') var test = require('tape') var WebTorrent = require('../../') test('Download using DHT (via magnet uri)', function (t) { - t.plan(10) + t.plan(11) var dhtServer = new DHT({ bootstrap: false }) @@ -24,7 +25,7 @@ test('Download using DHT (via magnet uri)', function (t) { function (cb) { client1 = new WebTorrent({ tracker: false, - dht: { bootstrap: '127.0.0.1:' + dhtServer.address().port } + dht: { bootstrap: '127.0.0.1:' + dhtServer.address().port, host: networkAddress.ipv4() } }) client1.on('error', function (err) { t.fail(err) }) @@ -33,6 +34,7 @@ test('Download using DHT (via magnet uri)', function (t) { var torrent = client1.add(common.leaves.parsedTorrent) torrent.on('dhtAnnounce', function () { + t.pass('finished dht announce') announced = true maybeDone() }) @@ -61,7 +63,7 @@ test('Download using DHT (via magnet uri)', function (t) { function (cb) { client2 = new WebTorrent({ tracker: false, - dht: { bootstrap: '127.0.0.1:' + dhtServer.address().port } + dht: { bootstrap: '127.0.0.1:' + dhtServer.address().port, host: networkAddress.ipv4() } }) client2.on('error', function (err) { t.fail(err) }) |