Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2015-12-10 09:31:19 +0300
committerFeross Aboukhadijeh <feross@feross.org>2015-12-17 14:39:55 +0300
commitdfdf52b747201cdb9f616a2b1f0831e96b250ab6 (patch)
tree139c69d7377b6b2653598da31a49dfd3ef702a5d /test/common.js
parent992caf9650a1f6821006387dfaf58f4004b17005 (diff)
test: put fixtures into single location
Diffstat (limited to 'test/common.js')
-rw-r--r--test/common.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/common.js b/test/common.js
new file mode 100644
index 0000000..691d178
--- /dev/null
+++ b/test/common.js
@@ -0,0 +1,34 @@
+var fs = require('fs')
+var path = require('path')
+var parseTorrent = require('parse-torrent')
+
+var content = path.join(__dirname, 'content')
+var torrents = path.join(__dirname, 'torrents')
+
+module.exports = {
+ // Leaves of Grass by Walt Whitman.epub
+ leaves: {
+ contentPath: path.join(content, 'Leaves of Grass by Walt Whitman.epub'),
+ torrentPath: path.join(torrents, 'leaves.torrent'),
+ content: fs.readFileSync(
+ path.join(content, 'Leaves of Grass by Walt Whitman.epub')
+ ),
+ torrent: fs.readFileSync(path.join(torrents, 'leaves.torrent')),
+ parsedTorrent: parseTorrent(
+ fs.readFileSync(path.join(torrents, 'leaves.torrent'))
+ ),
+ magnetURI: parseTorrent.toMagnetURI(
+ parseTorrent(fs.readFileSync(path.join(torrents, 'leaves.torrent')))
+ )
+ },
+
+ // Folder which contains single file
+ folder: {
+ contentPath: path.join(content, 'folder')
+ },
+
+ // Folder which contains multiple files
+ numbers: {
+ contentPath: path.join(content, 'numbers')
+ }
+}