diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2016-01-01 22:53:53 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2016-01-01 22:53:53 +0300 |
commit | 8e3ae1f7a544c1bd9880f4548fdf2bd2642fb52c (patch) | |
tree | 63487c6740c98fc5d951f70bea4a52ae4b512764 /test | |
parent | ec8cd2ca6a09ecb84ff2b5602ec6f6c909a90f7c (diff) |
test: client.add: invalid torrent id: invalid filesystem path
Diffstat (limited to 'test')
-rw-r--r-- | test/node/basic.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/node/basic.js b/test/node/basic.js index c03eb93..b225b8d 100644 --- a/test/node/basic.js +++ b/test/node/basic.js @@ -114,3 +114,19 @@ test('client.seed: filesystem path to folder with multiple files, string', funct client.destroy(function (err) { t.error(err, 'client destroyed') }) }) }) + +test('client.add: invalid torrent id: invalid filesystem path', function (t) { + t.plan(3) + + var client = new WebTorrent({ dht: false, tracker: false }) + + client.on('error', function (err) { + t.ok(err instanceof Error) + t.ok(err.message.indexOf('Invalid torrent identifier') >= 0) + + client.destroy(function (err) { t.error(err, 'client destroyed') }) + }) + client.on('warning', function (err) { t.fail(err) }) + + client.add('/invalid/filesystem/path/123') +}) |