diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2015-07-17 09:16:06 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2015-07-17 09:16:06 +0300 |
commit | 8309ca73c0179499a4e43c1fef07380cae17aea3 (patch) | |
tree | 06d1ed66144ed741e8b99156da6f75b2c8f47aea /test | |
parent | 4b00567df1534ae18d7ffc63c0d48319164901d7 (diff) |
add failing test for torrent.destroy() remove from client
Diffstat (limited to 'test')
-rw-r--r-- | test/basic.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/basic.js b/test/basic.js index 2a74099..aab3f72 100644 --- a/test/basic.js +++ b/test/basic.js @@ -109,6 +109,19 @@ test('client.remove: remove by Torrent object', function (t) { }) }) +test('torrent.destroy: destroy and remove torrent', function (t) { + var client = new WebTorrent({ dht: false, tracker: false }) + var torrent = client.add(leavesTorrent.infoHash) + t.equal(client.torrents.length, 1) + torrent.on('infoHash', function () { + t.equal(torrent.infoHash, leavesTorrent.infoHash) + torrent.destroy() + t.equal(client.torrents.length, 0) + client.destroy() + t.end() + }) +}) + test('client.seed: torrent file (Buffer)', function (t) { t.plan(4) |