Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support seeding entire folders (string path to folder) #213

Merged
merged 4 commits into from Dec 22, 2014
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Next

add client.seed test for path to folder (string)

  • Loading branch information
feross committed Dec 17, 2014
commit c0d1c9ccb7a281fcfc507f858be418dacb7a5f32
@@ -9,6 +9,7 @@ var leavesPath = __dirname + '/torrents/leaves.torrent'
var leaves = fs.readFileSync(leavesPath)
var leavesTorrent = parseTorrent(leaves)
var leavesBookPath = __dirname + '/content/Leaves of Grass by Walt Whitman.epub'
var numbersPath = __dirname + '/content/numbers'

test('client.add (http url to a torrent file (string))', function (t) {
t.plan(1)
@@ -50,3 +51,21 @@ test('client.seed (filesystem path to file (string))', function (t) {
client.destroy()
})
})

test('client.seed (filesystem path to folder (string))', function (t) {
t.plan(1)

var opts = {
pieceLength: 32768, // force piece length to 32KB so info-hash will
// match what transmission generated, since we use
// a different algo for picking piece length

private: false // also force `private: false` to match transmission
}

var client = new WebTorrent({ dht: false, trackers: false })
client.seed(numbersPath, opts, function (torrent) {
t.equal(torrent.infoHash, '80562f38656b385ea78959010e51a2cc9db41ea0')
client.destroy()
})
})
@@ -0,0 +1 @@
1
@@ -0,0 +1 @@
22
@@ -0,0 +1 @@
333
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.