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
path: root/test
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2016-01-10 20:29:57 +0300
committerFeross Aboukhadijeh <feross@feross.org>2016-01-11 02:09:00 +0300
commitf6290e9d6230538117d2db205596e28986f27066 (patch)
tree086fa0ce21eb49e89f3680431221b0a23c720dcf /test
parentadb520d80d36f35e7c9aea18f2164fd23f509949 (diff)
tests: cleanup
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/sintel-5gb.torrentbin26474 -> 0 bytes
-rw-r--r--test/node/download-dht-magnet.js7
-rw-r--r--test/node/download-dht-torrent.js2
-rw-r--r--test/node/download-private-dht.js2
-rw-r--r--test/node/download-tracker-magnet.js6
-rw-r--r--test/node/download-webseed-magnet.js9
6 files changed, 11 insertions, 15 deletions
diff --git a/test/fixtures/sintel-5gb.torrent b/test/fixtures/sintel-5gb.torrent
deleted file mode 100644
index 49c35de..0000000
--- a/test/fixtures/sintel-5gb.torrent
+++ /dev/null
Binary files differ
diff --git a/test/node/download-dht-magnet.js b/test/node/download-dht-magnet.js
index eb2e56d..9ddba86 100644
--- a/test/node/download-dht-magnet.js
+++ b/test/node/download-dht-magnet.js
@@ -14,7 +14,6 @@ test('Download using DHT (via magnet uri)', function (t) {
dhtServer.on('error', function (err) { t.fail(err) })
dhtServer.on('warning', function (err) { t.fail(err) })
- var magnetUri = 'magnet:?xt=urn:btih:' + common.leaves.parsedTorrent.infoHash
var client1, client2
series([
@@ -56,7 +55,7 @@ test('Download using DHT (via magnet uri)', function (t) {
var announced = false
var loaded = false
function maybeDone () {
- if (announced && loaded) cb(null, client1)
+ if (announced && loaded) cb(null)
}
},
@@ -86,12 +85,12 @@ test('Download using DHT (via magnet uri)', function (t) {
})
})
- client2.add(magnetUri)
+ client2.add(common.leaves.magnetURI)
var gotBuffer = false
var gotDone = false
function maybeDone () {
- if (gotBuffer && gotDone) cb(null, client2)
+ if (gotBuffer && gotDone) cb(null)
}
}
], function (err) {
diff --git a/test/node/download-dht-torrent.js b/test/node/download-dht-torrent.js
index fc918bd..b6262c3 100644
--- a/test/node/download-dht-torrent.js
+++ b/test/node/download-dht-torrent.js
@@ -84,7 +84,7 @@ test('Download using DHT (via .torrent file)', function (t) {
var torrentDone = false
var gotBuffer = false
function maybeDone () {
- if (torrentDone && gotBuffer) cb(null, client2)
+ if (torrentDone && gotBuffer) cb(null)
}
})
diff --git a/test/node/download-private-dht.js b/test/node/download-private-dht.js
index ca0a8e3..ee5125e 100644
--- a/test/node/download-private-dht.js
+++ b/test/node/download-private-dht.js
@@ -80,7 +80,7 @@ test('public torrent should use DHT', function (t) {
torrent.on('dhtAnnounce', function () {
t.pass('client announced to dht')
- cb(null, client)
+ cb(null)
})
client.on('torrent', function () {
diff --git a/test/node/download-tracker-magnet.js b/test/node/download-tracker-magnet.js
index 919957b..12607e7 100644
--- a/test/node/download-tracker-magnet.js
+++ b/test/node/download-tracker-magnet.js
@@ -30,7 +30,7 @@ function magnetDownloadTest (t, serverType) {
})
var parsedTorrent = extend(common.leaves.parsedTorrent)
- var magnetUri, client1, client2
+ var magnetURI, client1, client2
series([
function (cb) {
@@ -44,7 +44,7 @@ function magnetDownloadTest (t, serverType) {
: 'udp://127.0.0.1:' + port
parsedTorrent.announce = [ announceUrl ]
- magnetUri = 'magnet:?xt=urn:btih:' + parsedTorrent.infoHash + '&tr=' + encodeURIComponent(announceUrl)
+ magnetURI = 'magnet:?xt=urn:btih:' + parsedTorrent.infoHash + '&tr=' + encodeURIComponent(announceUrl)
client1 = new WebTorrent({ dht: false })
@@ -98,7 +98,7 @@ function magnetDownloadTest (t, serverType) {
}
})
- client2.add(magnetUri)
+ client2.add(magnetURI)
}
], function (err) {
diff --git a/test/node/download-webseed-magnet.js b/test/node/download-webseed-magnet.js
index c55683f..b963446 100644
--- a/test/node/download-webseed-magnet.js
+++ b/test/node/download-webseed-magnet.js
@@ -10,8 +10,6 @@ var WebTorrent = require('../../')
test('Download using webseed (via magnet uri)', function (t) {
t.plan(9)
- var parsedTorrent = common.leaves.parsedTorrent
-
var serve = serveStatic(path.join(__dirname, 'content'))
var httpServer = http.createServer(function (req, res) {
var done = finalhandler(req, res)
@@ -58,7 +56,7 @@ test('Download using webseed (via magnet uri)', function (t) {
maybeDone()
})
- client1.add(parsedTorrent)
+ client1.add(common.leaves.parsedTorrent)
},
function (cb) {
@@ -68,8 +66,7 @@ test('Download using webseed (via magnet uri)', function (t) {
client2.on('warning', function (err) { t.fail(err) })
var webSeedUrl = 'http://localhost:' + httpServer.address().port + '/' + common.leaves.parsedTorrent.name
- var magnetUri = 'magnet:?xt=urn:btih:' + parsedTorrent.infoHash +
- '&ws=' + encodeURIComponent(webSeedUrl)
+ var magnetURI = common.leaves.magnetURI + '&ws=' + encodeURIComponent(webSeedUrl)
client2.on('torrent', function (torrent) {
torrent.files.forEach(function (file) {
@@ -98,7 +95,7 @@ test('Download using webseed (via magnet uri)', function (t) {
torrent.addPeer('127.0.0.1:' + client1.address().port)
})
- client2.add(magnetUri)
+ client2.add(magnetURI)
}
], function (err) {
t.error(err)