Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'test/node/download-webseed-magnet.js')
-rw-r--r--test/node/download-webseed-magnet.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/node/download-webseed-magnet.js b/test/node/download-webseed-magnet.js
index 47a10f6..e0d39bf 100644
--- a/test/node/download-webseed-magnet.js
+++ b/test/node/download-webseed-magnet.js
@@ -51,12 +51,12 @@ test('Download using webseed (via magnet uri)', function (t) {
maybeDone()
})
- client1.on('listening', function () {
+ var torrent = client1.add(fixtures.leaves.parsedTorrent)
+
+ torrent.on('infoHash', function () {
gotListening = true
maybeDone()
})
-
- client1.add(fixtures.leaves.parsedTorrent)
},
function (cb) {
@@ -91,11 +91,11 @@ test('Download using webseed (via magnet uri)', function (t) {
}
})
- client2.on('listening', function (port, torrent) {
+ var torrent = client2.add(magnetURI)
+
+ torrent.on('infoHash', function () {
torrent.addPeer('127.0.0.1:' + client1.address().port)
})
-
- client2.add(magnetURI)
}
], function (err) {
t.error(err)