diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2015-01-26 22:12:01 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2015-01-26 22:12:01 +0300 |
commit | 2570b37e1f7b90ae89530c4b4fb58d90b048aa7a (patch) | |
tree | a7912ecf8a8a5d756d142da7772f6b984859cb84 /test/basic.js | |
parent | acad9f00197aeb593573f3fc4ae39b294bce975b (diff) |
throw if add or seed after destroy
For #254
Diffstat (limited to 'test/basic.js')
-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 54ab2ff..1e3db44 100644 --- a/test/basic.js +++ b/test/basic.js @@ -83,3 +83,16 @@ test('client.seed (Buffer, Blob)', function (t) { console.log('Skipping Blob test because missing `Blob` constructor') } }) + +test('throw if add or seed after destroy', function (t) { + var client = new WebTorrent({ dht: false, tracker: false }) + client.destroy() + t.throws(function () { + client.add('magnet:?xt=urn:btih:' + leavesTorrent.infoHash) + }) + t.throws(function () { + client.seed(new Buffer('sup')) + }) + t.end() +}) + |