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>2015-05-18 02:34:21 +0300
committerFeross Aboukhadijeh <feross@feross.org>2015-05-18 02:34:21 +0300
commit1dae3cba494c0371012a8b781573279af4c75fe9 (patch)
treec2d4638ee5aec7c2cde0da63ad08a067c363880a /test
parentcb80413d945a70e08be9d5fd69fa6aaffbce4d65 (diff)
add test: remove by Torrent object
Diffstat (limited to 'test')
-rw-r--r--test/basic.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/basic.js b/test/basic.js
index 5d8bd7b..1b8cffc 100644
--- a/test/basic.js
+++ b/test/basic.js
@@ -74,6 +74,19 @@ test('client.add/remove: parsed torrent, from `parse-torrent`', function (t) {
t.end()
})
+test('client.remove: remove by Torrent object', function (t) {
+ var client = new WebTorrent({ dht: false, tracker: false })
+ var torrent = client.add(leavesTorrent.infoHash)
+ t.equal(client.torrents.length, 1)
+ t.equal(torrent.infoHash, leavesTorrent.infoHash)
+
+ client.remove(torrent)
+ t.equal(client.torrents.length, 0)
+ client.destroy()
+
+ t.end()
+})
+
test('client.seed (Buffer, Blob)', function (t) {
t.plan(global.Blob !== undefined ? 8 : 4)