diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2016-02-28 06:10:08 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2016-02-28 06:10:08 +0300 |
commit | ff552814b86d11c171226c20efd9c9d1c3d968be (patch) | |
tree | 13721145118b68b20ca6eaa478ba259cab703252 /test/client-seed.js | |
parent | 0d2dc8c90900d1ea2103f6a457c76c7998eab3a6 (diff) |
use webtorrent-fixtures
Diffstat (limited to 'test/client-seed.js')
-rw-r--r-- | test/client-seed.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/client-seed.js b/test/client-seed.js index 98ab0d0..1f50d9b 100644 --- a/test/client-seed.js +++ b/test/client-seed.js @@ -1,6 +1,6 @@ /* global Blob */ -var common = require('./common') +var fixtures = require('webtorrent-fixtures') var test = require('tape') var WebTorrent = require('../') @@ -12,12 +12,12 @@ test('client.seed: torrent file (Buffer)', function (t) { client.on('error', function (err) { t.fail(err) }) client.on('warning', function (err) { t.fail(err) }) - client.seed(common.leaves.content, { + client.seed(fixtures.leaves.content, { name: 'Leaves of Grass by Walt Whitman.epub' }, function (torrent) { t.equal(client.torrents.length, 1) - t.equal(torrent.infoHash, common.leaves.parsedTorrent.infoHash) - t.equal(torrent.magnetURI, common.leaves.magnetURI) + t.equal(torrent.infoHash, fixtures.leaves.parsedTorrent.infoHash) + t.equal(torrent.magnetURI, fixtures.leaves.magnetURI) client.remove(torrent, function (err) { t.error(err, 'torrent removed') }) t.equal(client.torrents.length, 0) @@ -34,13 +34,13 @@ test('client.seed: torrent file (Buffer), set name on buffer', function (t) { client.on('error', function (err) { t.fail(err) }) client.on('warning', function (err) { t.fail(err) }) - var buf = new Buffer(common.leaves.content) + var buf = new Buffer(fixtures.leaves.content) buf.name = 'Leaves of Grass by Walt Whitman.epub' client.seed(buf, function (torrent) { t.equal(client.torrents.length, 1) - t.equal(torrent.infoHash, common.leaves.parsedTorrent.infoHash) - t.equal(torrent.magnetURI, common.leaves.magnetURI) + t.equal(torrent.infoHash, fixtures.leaves.parsedTorrent.infoHash) + t.equal(torrent.magnetURI, fixtures.leaves.magnetURI) client.remove(torrent, function (err) { t.error(err, 'torrent removed') }) t.equal(client.torrents.length, 0) @@ -59,12 +59,12 @@ test('client.seed: torrent file (Blob)', function (t) { client.on('error', function (err) { t.fail(err) }) client.on('warning', function (err) { t.fail(err) }) - client.seed(new Blob([ common.leaves.content ]), { + client.seed(new Blob([ fixtures.leaves.content ]), { name: 'Leaves of Grass by Walt Whitman.epub' }, function (torrent) { t.equal(client.torrents.length, 1) - t.equal(torrent.infoHash, common.leaves.parsedTorrent.infoHash) - t.equal(torrent.magnetURI, common.leaves.magnetURI) + t.equal(torrent.infoHash, fixtures.leaves.parsedTorrent.infoHash) + t.equal(torrent.magnetURI, fixtures.leaves.magnetURI) client.remove(torrent, function (err) { t.error(err, 'torrent removed') }) t.equal(client.torrents.length, 0) |