diff options
Diffstat (limited to 'test/node')
-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') +}) |