diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2020-10-29 07:32:23 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2020-10-29 07:32:23 +0300 |
commit | c73870ad0edd8f696f0a8e93289a34f0c536e3db (patch) | |
tree | 8adda2773b55d089660d07267b924934d782006b /test/duplicate.js | |
parent | f6121c311b754591a737aec0d3abce299b4908c8 (diff) |
Convert the tests to use let/const instead of var
Diffstat (limited to 'test/duplicate.js')
-rw-r--r-- | test/duplicate.js | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/test/duplicate.js b/test/duplicate.js index a189660..e8cdef7 100644 --- a/test/duplicate.js +++ b/test/duplicate.js @@ -1,11 +1,11 @@ -var fixtures = require('webtorrent-fixtures') -var test = require('tape') -var WebTorrent = require('../') +const fixtures = require('webtorrent-fixtures') +const test = require('tape') +const WebTorrent = require('../') test('client.seed followed by duplicate client.add (sync)', function (t) { t.plan(6) - var client = new WebTorrent({ dht: false, tracker: false }) + const client = new WebTorrent({ dht: false, tracker: false }) client.on('error', function (err) { t.fail(err) }) client.on('warning', function (err) { t.fail(err) }) @@ -15,7 +15,7 @@ test('client.seed followed by duplicate client.add (sync)', function (t) { }, function (torrent1) { t.equal(client.torrents.length, 1) - var torrent2 = client.add(torrent1.infoHash) + const torrent2 = client.add(torrent1.infoHash) torrent2.once('ready', function () { t.fail('torrent ready is not called') @@ -36,7 +36,7 @@ test('client.seed followed by duplicate client.add (sync)', function (t) { test('client.seed followed by duplicate client.add (async)', function (t) { t.plan(6) - var client = new WebTorrent({ dht: false, tracker: false }) + const client = new WebTorrent({ dht: false, tracker: false }) client.on('error', function (err) { t.fail(err) }) client.on('warning', function (err) { t.fail(err) }) @@ -46,7 +46,7 @@ test('client.seed followed by duplicate client.add (async)', function (t) { }, function (torrent1) { t.equal(client.torrents.length, 1) - var torrent2 = client.add(fixtures.leaves.torrentPath) + const torrent2 = client.add(fixtures.leaves.torrentPath) torrent2.once('ready', function () { t.fail('torrent ready is not called') @@ -67,7 +67,7 @@ test('client.seed followed by duplicate client.add (async)', function (t) { test('client.seed followed by two duplicate client.add calls (sync)', function (t) { t.plan(9) - var client = new WebTorrent({ dht: false, tracker: false }) + const client = new WebTorrent({ dht: false, tracker: false }) client.on('error', function (err) { t.fail(err) }) client.on('warning', function (err) { t.fail(err) }) @@ -77,7 +77,7 @@ test('client.seed followed by two duplicate client.add calls (sync)', function ( }, function (torrent1) { t.equal(client.torrents.length, 1) - var torrent2 = client.add(torrent1.infoHash) + const torrent2 = client.add(torrent1.infoHash) torrent2.once('ready', function () { t.fail('torrent ready is not called') @@ -88,7 +88,7 @@ test('client.seed followed by two duplicate client.add calls (sync)', function ( t.equal(client.torrents.length, 1) t.ok(torrent2.destroyed) - var torrent3 = client.add(torrent1.infoHash) + const torrent3 = client.add(torrent1.infoHash) torrent3.once('ready', function () { t.fail('torrent ready is not called') @@ -110,7 +110,7 @@ test('client.seed followed by two duplicate client.add calls (sync)', function ( test('client.seed followed by two duplicate client.add calls (async)', function (t) { t.plan(9) - var client = new WebTorrent({ dht: false, tracker: false }) + const client = new WebTorrent({ dht: false, tracker: false }) client.on('error', function (err) { t.fail(err) }) client.on('warning', function (err) { t.fail(err) }) @@ -120,7 +120,7 @@ test('client.seed followed by two duplicate client.add calls (async)', function }, function (torrent1) { t.equal(client.torrents.length, 1) - var torrent2 = client.add(fixtures.leaves.torrentPath) + const torrent2 = client.add(fixtures.leaves.torrentPath) torrent2.once('ready', function () { t.fail('torrent ready is not called') @@ -131,7 +131,7 @@ test('client.seed followed by two duplicate client.add calls (async)', function t.equal(client.torrents.length, 1) t.ok(torrent2.destroyed) - var torrent3 = client.add(fixtures.leaves.torrentPath) + const torrent3 = client.add(fixtures.leaves.torrentPath) torrent3.once('ready', function () { t.fail('torrent ready is not called') @@ -153,7 +153,7 @@ test('client.seed followed by two duplicate client.add calls (async)', function test('successive sync client.add, client.remove, client.add, client.remove (sync)', function (t) { t.plan(3) - var client = new WebTorrent({ dht: false, tracker: false }) + const client = new WebTorrent({ dht: false, tracker: false }) client.on('error', function (err) { t.fail(err) }) client.on('warning', function (err) { t.fail(err) }) |