Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('client.seed: filesystem path to folder with one file, string', function (t) {
t.plan(6)
var client = new WebTorrent({ dht: false, tracker: false })
client.on('error', function (err) { t.fail(err) })
client.on('warning', function (err) { t.fail(err) })
client.seed(fixtures.folder.contentPath, { announce: [] }, function (torrent) {
t.equal(client.torrents.length, 1)
t.equal(torrent.infoHash, fixtures.folder.parsedTorrent.infoHash)
t.equal(torrent.magnetURI, fixtures.folder.magnetURI)
client.remove(torrent, function (err) { t.error(err, 'torrent destroyed') })
t.equal(client.torrents.length, 0)
client.destroy(function (err) { t.error(err, 'client destroyed') })
})
})
client.seed(fixtures.folder.contentPath, { announce: [] }, function (torrent) {
t.equal(client.torrents.length, 1)
t.equal(torrent.infoHash, fixtures.folder.parsedTorrent.infoHash)
t.equal(torrent.magnetURI, fixtures.folder.magnetURI)
client.remove(torrent, function (err) { t.error(err, 'torrent destroyed') })
t.equal(client.torrents.length, 0)
client.destroy(function (err) { t.error(err, 'client destroyed') })
})
})