diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2015-12-30 02:03:00 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2015-12-30 02:03:00 +0300 |
commit | 0b4dfc608600390b108b846a7bebd293ebf73937 (patch) | |
tree | 976d21b7bd13dc6f162884aaad969619d731444d /test/multiple.js | |
parent | b378a8e40b62348733d7bef4a75ec1798e2b1131 (diff) |
Add more browser tests
Run more of the tests in the browser. There's now a test/node and test/browser folder for tests that are specific to each environment. Anything in test/ will be run in both environments.
Diffstat (limited to 'test/multiple.js')
-rw-r--r-- | test/multiple.js | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/test/multiple.js b/test/multiple.js deleted file mode 100644 index f843bf7..0000000 --- a/test/multiple.js +++ /dev/null @@ -1,61 +0,0 @@ -/* -var path = require('path') -var fs = require('fs') -var test = require('tape') -var WebTorrent = require('../') - -var torrents = [ 'leaves', 'pride' ].map(function (name) { - return fs.readFileSync(path.resolve(__dirname, 'torrents', name + '.torrent')) -}) - -// TODO: replace this with a test that can run offline -test('two simultaneous downloads with dht disabled', function (t) { - t.plan(torrents.length * 2) - - var client = new WebTorrent({ dht: false }) - var numDone = 0 - - client.on('error', function (err) { t.fail(err.message) }) - - torrents.forEach(function (torrent) { - client.add(torrent) - }) - - client.on('torrent', function (torrent) { - t.pass('received metadata for torrent ' + torrent.name) - - torrent.once('done', function () { - t.pass('done downloading torrent ' + torrent.name) - - if (++numDone >= torrents.length) { - client.destroy() - } - }) - }) -}) - -test('two simultaneous downloads with dht enabled', function (t) { - t.plan(torrents.length * 2) - - var client = new WebTorrent() - var numDone = 0 - - client.on('error', function (err) { t.fail(err.message) }) - - torrents.forEach(function (torrent) { - client.add(torrent) - }) - - client.on('torrent', function (torrent) { - t.pass('received metadata for torrent ' + torrent.name) - - torrent.once('done', function () { - t.pass('done downloading torrent ' + torrent.name) - - if (++numDone >= torrents.length) { - client.destroy() - } - }) - }) -}) -*/ |