From 733e571a436951a8178d293cfa7315ad6bccf6b5 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 5 Jul 2019 14:37:45 -0700 Subject: standard --- test/client-add-duplicate-trackers.js | 10 +++++----- test/client-add.js | 6 +++--- test/client-seed.js | 2 +- test/node/blocklist-dht.js | 2 +- test/node/blocklist-tracker.js | 2 +- test/node/blocklist.js | 4 ++-- test/node/download-dht-magnet.js | 2 +- test/node/download-dht-torrent.js | 2 +- test/node/download-tracker-magnet.js | 2 +- test/node/download-tracker-torrent.js | 2 +- test/node/seed-stream.js | 2 +- 11 files changed, 18 insertions(+), 18 deletions(-) (limited to 'test') diff --git a/test/client-add-duplicate-trackers.js b/test/client-add-duplicate-trackers.js index 161e920..3c9c366 100644 --- a/test/client-add-duplicate-trackers.js +++ b/test/client-add-duplicate-trackers.js @@ -11,7 +11,7 @@ test('client.add: duplicate trackers', function (t) { client.on('warning', function (err) { t.fail(err) }) var torrent = client.add(fixtures.leaves.torrent, { - announce: [ 'wss://example.com', 'wss://example.com', 'wss://example.com' ] + announce: ['wss://example.com', 'wss://example.com', 'wss://example.com'] }) torrent.on('ready', function () { @@ -26,7 +26,7 @@ test('client.add: duplicate trackers, with multiple torrents', function (t) { // Re-use this object, in case webtorrent is changing it var opts = { - announce: [ 'wss://example.com', 'wss://example.com', 'wss://example.com' ] + announce: ['wss://example.com', 'wss://example.com', 'wss://example.com'] } var client = new WebTorrent({ dht: false, tracker: false }) @@ -56,15 +56,15 @@ test('client.add: duplicate trackers (including in .torrent file), multiple torr // Re-use this object, in case webtorrent is changing it var opts = { - announce: [ 'wss://example.com', 'wss://example.com', 'wss://example.com' ] + announce: ['wss://example.com', 'wss://example.com', 'wss://example.com'] } // Include the duplicate trackers in the .torrent files var parsedTorrentLeaves = Object.assign({}, fixtures.leaves.parsedTorrent) - parsedTorrentLeaves.announce = [ 'wss://example.com', 'wss://example.com', 'wss://example.com' ] + parsedTorrentLeaves.announce = ['wss://example.com', 'wss://example.com', 'wss://example.com'] var parsedTorrentAlice = Object.assign({}, fixtures.alice.parsedTorrent) - parsedTorrentAlice.announce = [ 'wss://example.com', 'wss://example.com', 'wss://example.com' ] + parsedTorrentAlice.announce = ['wss://example.com', 'wss://example.com', 'wss://example.com'] var client = new WebTorrent({ dht: false, tracker: false }) diff --git a/test/client-add.js b/test/client-add.js index 009cdc6..3a46dbe 100644 --- a/test/client-add.js +++ b/test/client-add.js @@ -135,7 +135,7 @@ test('client.add: parsed torrent, with string type announce property', function t.equal(torrent.magnetURI, expectedMagnetURI) // `torrent.announce` must always be an array - t.deepEqual(torrent.announce, [ 'http://tracker.local:80' ]) + t.deepEqual(torrent.announce, ['http://tracker.local:80']) client.remove(fixtures.leaves.parsedTorrent, function (err) { t.error(err, 'torrent destroyed') }) t.equal(client.torrents.length, 0) @@ -153,7 +153,7 @@ test('client.add: parsed torrent, with array type announce property', function ( client.on('warning', function (err) { t.fail(err) }) var parsedTorrent = Object.assign({}, fixtures.leaves.parsedTorrent) - parsedTorrent.announce = [ 'http://tracker.local:80', 'http://tracker.local:81' ] + parsedTorrent.announce = ['http://tracker.local:80', 'http://tracker.local:81'] var torrent = client.add(parsedTorrent) t.equal(client.torrents.length, 1) @@ -166,7 +166,7 @@ test('client.add: parsed torrent, with array type announce property', function ( '&tr=' + encodeURIComponent('http://tracker.local:81') t.equal(torrent.magnetURI, expectedMagnetURI) - t.deepEqual(torrent.announce, [ 'http://tracker.local:80', 'http://tracker.local:81' ]) + t.deepEqual(torrent.announce, ['http://tracker.local:80', 'http://tracker.local:81']) client.remove(fixtures.leaves.parsedTorrent, function (err) { t.error(err, 'torrent destroyed') }) t.equal(client.torrents.length, 0) diff --git a/test/client-seed.js b/test/client-seed.js index 48d958d..fc0e6a4 100644 --- a/test/client-seed.js +++ b/test/client-seed.js @@ -61,7 +61,7 @@ test('client.seed: torrent file (Blob)', function (t) { client.on('error', function (err) { t.fail(err) }) client.on('warning', function (err) { t.fail(err) }) - client.seed(new Blob([ fixtures.leaves.content ]), { + client.seed(new Blob([fixtures.leaves.content]), { name: 'Leaves of Grass by Walt Whitman.epub', announce: [] }, function (torrent) { diff --git a/test/node/blocklist-dht.js b/test/node/blocklist-dht.js index 3e23424..e956731 100644 --- a/test/node/blocklist-dht.js +++ b/test/node/blocklist-dht.js @@ -58,7 +58,7 @@ test('blocklist blocks peers discovered via DHT', function (t) { client2 = new WebTorrent({ tracker: false, dht: { bootstrap: '127.0.0.1:' + dhtServer.address().port }, - blocklist: [ '127.0.0.1' ] + blocklist: ['127.0.0.1'] }) client2.on('error', function (err) { t.fail(err) }) client2.on('warning', function (err) { t.fail(err) }) diff --git a/test/node/blocklist-tracker.js b/test/node/blocklist-tracker.js index 7c92e9a..302bd8f 100644 --- a/test/node/blocklist-tracker.js +++ b/test/node/blocklist-tracker.js @@ -53,7 +53,7 @@ test('blocklist blocks peers discovered via tracker', function (t) { function (cb) { client2 = new WebTorrent({ dht: false, - blocklist: [ '127.0.0.1' ] + blocklist: ['127.0.0.1'] }) client2.on('error', function (err) { t.fail(err) }) client2.on('warning', function (err) { t.fail(err) }) diff --git a/test/node/blocklist.js b/test/node/blocklist.js index f39b232..87c131f 100644 --- a/test/node/blocklist.js +++ b/test/node/blocklist.js @@ -25,7 +25,7 @@ test('blocklist (single IP)', function (t) { var client = new WebTorrent({ dht: false, tracker: false, - blocklist: [ '1.2.3.4' ] + blocklist: ['1.2.3.4'] }) client.on('error', function (err) { t.fail(err) }) client.on('warning', function (err) { t.fail(err) }) @@ -51,7 +51,7 @@ test('blocklist (array of IPs)', function (t) { var client = new WebTorrent({ dht: false, tracker: false, - blocklist: [ '1.2.3.4', '5.6.7.8' ] + blocklist: ['1.2.3.4', '5.6.7.8'] }) .on('error', function (err) { t.fail(err) }) .on('warning', function (err) { t.fail(err) }) diff --git a/test/node/download-dht-magnet.js b/test/node/download-dht-magnet.js index aeb580a..3372317 100644 --- a/test/node/download-dht-magnet.js +++ b/test/node/download-dht-magnet.js @@ -47,7 +47,7 @@ test('Download using DHT (via magnet uri)', function (t) { // torrent metadata has been fetched -- sanity check it t.equal(torrent.name, 'Leaves of Grass by Walt Whitman.epub') - var names = [ 'Leaves of Grass by Walt Whitman.epub' ] + var names = ['Leaves of Grass by Walt Whitman.epub'] t.deepEqual(torrent.files.map(function (file) { return file.name }), names) }) diff --git a/test/node/download-dht-torrent.js b/test/node/download-dht-torrent.js index b9fc932..9d5a93b 100644 --- a/test/node/download-dht-torrent.js +++ b/test/node/download-dht-torrent.js @@ -40,7 +40,7 @@ test('Download using DHT (via .torrent file)', function (t) { // torrent metadata has been fetched -- sanity check it t.equal(torrent.name, 'Leaves of Grass by Walt Whitman.epub') - var names = [ 'Leaves of Grass by Walt Whitman.epub' ] + var names = ['Leaves of Grass by Walt Whitman.epub'] t.deepEqual(torrent.files.map(function (file) { return file.name }), names) }) diff --git a/test/node/download-tracker-magnet.js b/test/node/download-tracker-magnet.js index de56007..e597191 100644 --- a/test/node/download-tracker-magnet.js +++ b/test/node/download-tracker-magnet.js @@ -43,7 +43,7 @@ function magnetDownloadTest (t, serverType) { ? 'http://127.0.0.1:' + port + '/announce' : 'udp://127.0.0.1:' + port - parsedTorrent.announce = [ announceUrl ] + parsedTorrent.announce = [announceUrl] magnetURI = 'magnet:?xt=urn:btih:' + parsedTorrent.infoHash + '&tr=' + encodeURIComponent(announceUrl) client1 = new WebTorrent({ dht: false }) diff --git a/test/node/download-tracker-torrent.js b/test/node/download-tracker-torrent.js index f1a04a9..17f9a0b 100644 --- a/test/node/download-tracker-torrent.js +++ b/test/node/download-tracker-torrent.js @@ -50,7 +50,7 @@ function torrentDownloadTest (t, serverType) { : 'udp://127.0.0.1:' + port // Overwrite announce with our local tracker - parsedTorrent.announce = [ announceUrl ] + parsedTorrent.announce = [announceUrl] client1.on('torrent', function (torrent) { // torrent metadata has been fetched -- sanity check it diff --git a/test/node/seed-stream.js b/test/node/seed-stream.js index eafc9e7..e56964e 100644 --- a/test/node/seed-stream.js +++ b/test/node/seed-stream.js @@ -36,7 +36,7 @@ test('client.seed: stream', function (t) { var seederOpts = { name: 'hello.txt', pieceLength: 5, - announce: [ announceUrl ] + announce: [announceUrl] } seeder.seed([stream], seederOpts, function (torrent) { magnetURI = torrent.magnetURI -- cgit v1.2.3