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:
authorDiego Rodríguez Baquero <github@diegorbaquero.com>2021-07-11 04:27:48 +0300
committerGitHub <noreply@github.com>2021-07-11 04:27:48 +0300
commit46033ae52eca6e22301bb8ed9566c498d3494711 (patch)
tree93cf4583fc9471dbe8e0b050c55b643638768f40 /test/client-destroy.js
parentfeb719d5426df7ad45d00ffadecb931780763134 (diff)
fix: modernize code (#2134)
* fix: modernize code * standard fix
Diffstat (limited to 'test/client-destroy.js')
-rw-r--r--test/client-destroy.js28
1 files changed, 14 insertions, 14 deletions
diff --git a/test/client-destroy.js b/test/client-destroy.js
index b42a25e..9117b8f 100644
--- a/test/client-destroy.js
+++ b/test/client-destroy.js
@@ -2,41 +2,41 @@ const fixtures = require('webtorrent-fixtures')
const test = require('tape')
const WebTorrent = require('../')
-test('after client.destroy(), throw on client.add() or client.seed()', function (t) {
+test('after client.destroy(), throw on client.add() or client.seed()', t => {
t.plan(3)
const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
- client.on('error', function (err) { t.fail(err) })
- client.on('warning', function (err) { t.fail(err) })
+ client.on('error', err => { t.fail(err) })
+ client.on('warning', err => { t.fail(err) })
- client.destroy(function (err) { t.error(err, 'client destroyed') })
+ client.destroy(err => { t.error(err, 'client destroyed') })
- t.throws(function () {
- client.add('magnet:?xt=urn:btih:' + fixtures.leaves.parsedTorrent.infoHash)
+ t.throws(() => {
+ client.add(`magnet:?xt=urn:btih:${fixtures.leaves.parsedTorrent.infoHash}`)
})
- t.throws(function () {
+ t.throws(() => {
client.seed(Buffer.from('sup'))
})
})
-test('after client.destroy(), no "torrent" or "ready" events emitted', function (t) {
+test('after client.destroy(), no "torrent" or "ready" events emitted', t => {
t.plan(1)
const client = new WebTorrent({ dht: false, tracker: false, lsd: false })
- client.on('error', function (err) { t.fail(err) })
- client.on('warning', function (err) { t.fail(err) })
+ client.on('error', err => { t.fail(err) })
+ client.on('warning', err => { t.fail(err) })
- client.add(fixtures.leaves.torrent, { name: 'leaves' }, function () {
+ client.add(fixtures.leaves.torrent, { name: 'leaves' }, () => {
t.fail('unexpected "torrent" event (from add)')
})
- client.seed(fixtures.leaves.content, { name: 'leaves' }, function () {
+ client.seed(fixtures.leaves.content, { name: 'leaves' }, () => {
t.fail('unexpected "torrent" event (from seed)')
})
- client.on('ready', function () {
+ client.on('ready', () => {
t.fail('unexpected "ready" event')
})
- client.destroy(function (err) { t.error(err, 'client destroyed') })
+ client.destroy(err => { t.error(err, 'client destroyed') })
})