diff options
Diffstat (limited to 'test/node')
-rw-r--r-- | test/node/download-dht-magnet.js | 6 | ||||
-rw-r--r-- | test/node/download-dht-torrent.js | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/test/node/download-dht-magnet.js b/test/node/download-dht-magnet.js index 028d6a6..760bb26 100644 --- a/test/node/download-dht-magnet.js +++ b/test/node/download-dht-magnet.js @@ -7,7 +7,7 @@ var test = require('tape') var WebTorrent = require('../../') test('Download using DHT (via magnet uri)', function (t) { - t.plan(11) + t.plan(12) var dhtServer = new DHT({ bootstrap: false }) @@ -27,6 +27,10 @@ test('Download using DHT (via magnet uri)', function (t) { dht: { bootstrap: '127.0.0.1:' + dhtServer.address().port, host: networkAddress.ipv4() } }) + client1.dht.on('listening', function () { + t.equal(client1.dhtPort, client1.dht.address().port) + }) + client1.on('error', function (err) { t.fail(err) }) client1.on('warning', function (err) { t.fail(err) }) diff --git a/test/node/download-dht-torrent.js b/test/node/download-dht-torrent.js index 5f88da5..20c7b0c 100644 --- a/test/node/download-dht-torrent.js +++ b/test/node/download-dht-torrent.js @@ -6,7 +6,7 @@ var test = require('tape') var WebTorrent = require('../../') test('Download using DHT (via .torrent file)', function (t) { - t.plan(8) + t.plan(9) var dhtServer = new DHT({ bootstrap: false }) @@ -26,6 +26,10 @@ test('Download using DHT (via .torrent file)', function (t) { dht: { bootstrap: '127.0.0.1:' + dhtServer.address().port } }) + client1.dht.on('listening', function () { + t.equal(client1.dhtPort, client1.dht.address().port) + }) + client1.on('error', function (err) { t.fail(err) }) client1.on('warning', function (err) { t.fail(err) }) |