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>2018-08-29 04:33:04 +0300
committerFeross Aboukhadijeh <feross@feross.org>2018-08-29 04:33:04 +0300
commit6fbef8e7bcc035b38468fd959c2f2da4d71edf47 (patch)
treee8015b4c82ccd699e85834529482c7144c7b87f5 /test
parent9da7bcdb5019565b9dc98c66d7e22b10e8d79cf3 (diff)
standard
Diffstat (limited to 'test')
-rw-r--r--test/client-seed.js2
-rw-r--r--test/node/basic.js4
-rw-r--r--test/node/download-dht-magnet.js4
-rw-r--r--test/node/download-dht-torrent.js4
-rw-r--r--test/node/download-metadata.js10
-rw-r--r--test/node/download-private-dht.js4
-rw-r--r--test/node/download-tracker-magnet.js4
-rw-r--r--test/node/download-tracker-torrent.js4
-rw-r--r--test/node/download-webseed-magnet.js4
-rw-r--r--test/node/download-webseed-torrent.js4
-rw-r--r--test/node/seed-while-download.js8
11 files changed, 26 insertions, 26 deletions
diff --git a/test/client-seed.js b/test/client-seed.js
index 7a41ba9..48d958d 100644
--- a/test/client-seed.js
+++ b/test/client-seed.js
@@ -39,7 +39,7 @@ test('client.seed: torrent file (Buffer), set name on buffer', function (t) {
var buf = Buffer.from(fixtures.leaves.content)
buf.name = 'Leaves of Grass by Walt Whitman.epub'
- client.seed(buf, {announce: []}, function (torrent) {
+ client.seed(buf, { announce: [] }, function (torrent) {
t.equal(client.torrents.length, 1)
t.equal(torrent.infoHash, fixtures.leaves.parsedTorrent.infoHash)
t.equal(torrent.magnetURI, fixtures.leaves.magnetURI)
diff --git a/test/node/basic.js b/test/node/basic.js
index f01aeef..f99e2ef 100644
--- a/test/node/basic.js
+++ b/test/node/basic.js
@@ -99,7 +99,7 @@ test('client.seed: filesystem path to folder with one file, string', function (t
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
- client.seed(fixtures.folder.contentPath, {announce: []}, function (torrent) {
+ client.seed(fixtures.folder.contentPath, { announce: [] }, function (torrent) {
t.equal(client.torrents.length, 1)
t.equal(torrent.infoHash, fixtures.folder.parsedTorrent.infoHash)
t.equal(torrent.magnetURI, fixtures.folder.magnetURI)
@@ -119,7 +119,7 @@ test('client.seed: filesystem path to folder with multiple files, string', funct
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
- client.seed(fixtures.numbers.contentPath, {announce: []}, function (torrent) {
+ client.seed(fixtures.numbers.contentPath, { announce: [] }, function (torrent) {
t.equal(client.torrents.length, 1)
t.equal(torrent.infoHash, fixtures.numbers.parsedTorrent.infoHash)
t.equal(torrent.magnetURI, fixtures.numbers.magnetURI)
diff --git a/test/node/download-dht-magnet.js b/test/node/download-dht-magnet.js
index f96a666..aeb580a 100644
--- a/test/node/download-dht-magnet.js
+++ b/test/node/download-dht-magnet.js
@@ -35,7 +35,7 @@ test('Download using DHT (via magnet uri)', function (t) {
client1.on('error', function (err) { t.fail(err) })
client1.on('warning', function (err) { t.fail(err) })
- var torrent = client1.add(fixtures.leaves.parsedTorrent, {store: MemoryChunkStore})
+ var torrent = client1.add(fixtures.leaves.parsedTorrent, { store: MemoryChunkStore })
torrent.on('dhtAnnounce', function () {
t.pass('finished dht announce')
@@ -90,7 +90,7 @@ test('Download using DHT (via magnet uri)', function (t) {
})
})
- client2.add(fixtures.leaves.magnetURI, {store: MemoryChunkStore})
+ client2.add(fixtures.leaves.magnetURI, { store: MemoryChunkStore })
var gotBuffer = false
var gotDone = false
diff --git a/test/node/download-dht-torrent.js b/test/node/download-dht-torrent.js
index 5182dd3..b9fc932 100644
--- a/test/node/download-dht-torrent.js
+++ b/test/node/download-dht-torrent.js
@@ -34,7 +34,7 @@ test('Download using DHT (via .torrent file)', function (t) {
client1.on('error', function (err) { t.fail(err) })
client1.on('warning', function (err) { t.fail(err) })
- var torrent = client1.add(fixtures.leaves.parsedTorrent, {store: MemoryChunkStore})
+ var torrent = client1.add(fixtures.leaves.parsedTorrent, { store: MemoryChunkStore })
torrent.on('ready', function () {
// torrent metadata has been fetched -- sanity check it
@@ -100,7 +100,7 @@ test('Download using DHT (via .torrent file)', function (t) {
}
})
- client2.add(fixtures.leaves.parsedTorrent, {store: MemoryChunkStore})
+ client2.add(fixtures.leaves.parsedTorrent, { store: MemoryChunkStore })
}
], function (err) {
t.error(err)
diff --git a/test/node/download-metadata.js b/test/node/download-metadata.js
index 1972f2e..9a185e9 100644
--- a/test/node/download-metadata.js
+++ b/test/node/download-metadata.js
@@ -33,7 +33,7 @@ test('Download metadata for magnet URI with xs parameter', function (t) {
createServer(fixtures.leaves.torrent, function (url, server) {
var encodedUrl = encodeURIComponent(url)
- client.add(fixtures.leaves.magnetURI + '&xs=' + encodedUrl, {store: MemoryChunkStore}, function (torrent) {
+ client.add(fixtures.leaves.magnetURI + '&xs=' + encodedUrl, { store: MemoryChunkStore }, function (torrent) {
t.equal(torrent.files[0].name, 'Leaves of Grass by Walt Whitman.epub')
client.destroy(function (err) { t.error(err, 'client destroyed') })
server.close(function () { t.pass('server closed') })
@@ -57,7 +57,7 @@ test('Download metadata for magnet URI with 2 xs parameters', function (t) {
var uri = fixtures.leaves.magnetURI + '&xs=' + encodedUrl1 + '&xs=' + encodedUrl2
- client.add(uri, {store: MemoryChunkStore}, function (torrent) {
+ client.add(uri, { store: MemoryChunkStore }, function (torrent) {
t.equal(torrent.files[0].name, 'Leaves of Grass by Walt Whitman.epub')
client.destroy(function (err) { t.error(err, 'client destroyed') })
server1.close(function () { t.pass('server closed') })
@@ -80,7 +80,7 @@ test('Download metadata for magnet URI with 2 xs parameters, with 1 invalid prot
var encodedUrl2 = encodeURIComponent(url)
var uri = fixtures.leaves.magnetURI + '&xs=' + encodedUrl1 + '&xs=' + encodedUrl2
- client.add(uri, {store: MemoryChunkStore}, function (torrent) {
+ client.add(uri, { store: MemoryChunkStore }, function (torrent) {
t.equal(torrent.files[0].name, 'Leaves of Grass by Walt Whitman.epub')
client.destroy(function (err) { t.error(err, 'client destroyed') })
server.close(function () { t.pass('server closed') })
@@ -101,7 +101,7 @@ test('Download metadata for magnet URI with 2 xs parameters, with 1 404 URL', fu
var encodedUrl2 = encodeURIComponent(url)
var uri = fixtures.leaves.magnetURI + '&xs=' + encodedUrl1 + '&xs=' + encodedUrl2
- client.add(uri, {store: MemoryChunkStore}, function (torrent) {
+ client.add(uri, { store: MemoryChunkStore }, function (torrent) {
t.equal(torrent.files[0].name, 'Leaves of Grass by Walt Whitman.epub')
client.destroy(function (err) { t.error(err, 'client destroyed') })
server.close(function () { t.pass('server closed') })
@@ -117,7 +117,7 @@ test('Download metadata magnet URI with unsupported protocol in xs parameter', f
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
- client.add(fixtures.leaves.magnetURI + '&xs=' + encodeURIComponent('invalidurl:example'), {store: MemoryChunkStore})
+ client.add(fixtures.leaves.magnetURI + '&xs=' + encodeURIComponent('invalidurl:example'), { store: MemoryChunkStore })
setTimeout(function () {
// no crash by now
diff --git a/test/node/download-private-dht.js b/test/node/download-private-dht.js
index 8a49798..35f90d3 100644
--- a/test/node/download-private-dht.js
+++ b/test/node/download-private-dht.js
@@ -29,7 +29,7 @@ test('private torrent should not use DHT', function (t) {
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
- var torrent = client.add(fixtures.bunny.parsedTorrent, {store: MemoryChunkStore})
+ var torrent = client.add(fixtures.bunny.parsedTorrent, { store: MemoryChunkStore })
torrent.on('dhtAnnounce', function () {
t.fail('client announced to dht')
@@ -77,7 +77,7 @@ test('public torrent should use DHT', function (t) {
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
- var torrent = client.add(fixtures.leaves.parsedTorrent, {store: MemoryChunkStore})
+ var torrent = client.add(fixtures.leaves.parsedTorrent, { store: MemoryChunkStore })
torrent.on('dhtAnnounce', function () {
t.pass('client announced to dht')
diff --git a/test/node/download-tracker-magnet.js b/test/node/download-tracker-magnet.js
index 9ffa233..1f51cdc 100644
--- a/test/node/download-tracker-magnet.js
+++ b/test/node/download-tracker-magnet.js
@@ -71,7 +71,7 @@ function magnetDownloadTest (t, serverType) {
})
})
- client1.add(parsedTorrent, {store: MemoryChunkStore})
+ client1.add(parsedTorrent, { store: MemoryChunkStore })
},
function (cb) {
@@ -103,7 +103,7 @@ function magnetDownloadTest (t, serverType) {
}
})
- client2.add(magnetURI, {store: MemoryChunkStore})
+ client2.add(magnetURI, { store: MemoryChunkStore })
}
], function (err) {
diff --git a/test/node/download-tracker-torrent.js b/test/node/download-tracker-torrent.js
index a2ba8e0..e44a8f4 100644
--- a/test/node/download-tracker-torrent.js
+++ b/test/node/download-tracker-torrent.js
@@ -66,7 +66,7 @@ function torrentDownloadTest (t, serverType) {
torrent.load(fs.createReadStream(fixtures.leaves.contentPath), cb)
})
- client1.add(parsedTorrent, {store: MemoryChunkStore})
+ client1.add(parsedTorrent, { store: MemoryChunkStore })
},
function (cb) {
@@ -74,7 +74,7 @@ function torrentDownloadTest (t, serverType) {
client2.on('error', function (err) { t.fail(err) })
client2.on('warning', function (err) { t.fail(err) })
- client2.add(parsedTorrent, {store: MemoryChunkStore})
+ client2.add(parsedTorrent, { store: MemoryChunkStore })
client2.on('torrent', function (torrent) {
torrent.files.forEach(function (file) {
diff --git a/test/node/download-webseed-magnet.js b/test/node/download-webseed-magnet.js
index 2f172a0..9a2ed07 100644
--- a/test/node/download-webseed-magnet.js
+++ b/test/node/download-webseed-magnet.js
@@ -52,7 +52,7 @@ test('Download using webseed (via magnet uri)', function (t) {
maybeDone()
})
- var torrent = client1.add(fixtures.leaves.parsedTorrent, {store: MemoryChunkStore})
+ var torrent = client1.add(fixtures.leaves.parsedTorrent, { store: MemoryChunkStore })
torrent.on('infoHash', function () {
gotListening = true
@@ -92,7 +92,7 @@ test('Download using webseed (via magnet uri)', function (t) {
}
})
- var torrent = client2.add(magnetURI, {store: MemoryChunkStore})
+ var torrent = client2.add(magnetURI, { store: MemoryChunkStore })
torrent.on('infoHash', function () {
torrent.addPeer('127.0.0.1:' + client1.address().port)
diff --git a/test/node/download-webseed-torrent.js b/test/node/download-webseed-torrent.js
index 39bec56..c257fd0 100644
--- a/test/node/download-webseed-torrent.js
+++ b/test/node/download-webseed-torrent.js
@@ -64,7 +64,7 @@ test('Download using webseed (via .torrent file)', function (t) {
}
})
- client.add(parsedTorrent, {store: MemoryChunkStore})
+ client.add(parsedTorrent, { store: MemoryChunkStore })
}
], function (err) {
t.error(err)
@@ -102,7 +102,7 @@ test('Disable webseeds', function (t) {
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
- client.add(parsedTorrent, {store: MemoryChunkStore})
+ client.add(parsedTorrent, { store: MemoryChunkStore })
// The test above ensures that we can download the whole torrent over webseeds within a
// short time. Here, we wait the same amount of time and make sure no HTTP requests happen.
diff --git a/test/node/seed-while-download.js b/test/node/seed-while-download.js
index 0ee61ad..b8f3500 100644
--- a/test/node/seed-while-download.js
+++ b/test/node/seed-while-download.js
@@ -30,7 +30,7 @@ test('Seed and download a file at the same time', function (t) {
client1.on('error', function (err) { t.fail(err) })
client1.on('warning', function (err) { t.fail(err) })
- var torrent = client1.add(fixtures.leaves.torrent, {store: MemoryChunkStore})
+ var torrent = client1.add(fixtures.leaves.torrent, { store: MemoryChunkStore })
torrent.on('dhtAnnounce', function () {
t.pass('client1 finished dht announce')
@@ -60,7 +60,7 @@ test('Seed and download a file at the same time', function (t) {
client2.on('error', function (err) { t.fail(err) })
client2.on('warning', function (err) { t.fail(err) })
- var torrent = client2.add(fixtures.alice.torrent, {store: MemoryChunkStore})
+ var torrent = client2.add(fixtures.alice.torrent, { store: MemoryChunkStore })
torrent.on('dhtAnnounce', function () {
t.pass('client2 finished dht announce')
@@ -82,7 +82,7 @@ test('Seed and download a file at the same time', function (t) {
},
function (cb) {
- client1.add(fixtures.alice.magnetURI, {store: MemoryChunkStore})
+ client1.add(fixtures.alice.magnetURI, { store: MemoryChunkStore })
client1.on('torrent', function (torrent) {
torrent.files[0].getBuffer(function (err, buf) {
@@ -99,7 +99,7 @@ test('Seed and download a file at the same time', function (t) {
})
})
- client2.add(fixtures.leaves.magnetURI, {store: MemoryChunkStore})
+ client2.add(fixtures.leaves.magnetURI, { store: MemoryChunkStore })
client2.on('torrent', function (torrent) {
torrent.files[0].getBuffer(function (err, buf) {