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
path: root/test
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2015-12-17 13:47:46 +0300
committerFeross Aboukhadijeh <feross@feross.org>2015-12-17 14:39:56 +0300
commit38e8383bf146f965c3712b095cbbc203f8d787cb (patch)
treef3cfe14ca12df28fc84e51025d1b8b96eefeed53 /test
parent914ddd546fff3b6ced22e685a4db8ea407aa4d23 (diff)
test: make fixtures work with brfs
Diffstat (limited to 'test')
-rw-r--r--test/common.js37
1 files changed, 16 insertions, 21 deletions
diff --git a/test/common.js b/test/common.js
index b68b0f4..c65ccb1 100644
--- a/test/common.js
+++ b/test/common.js
@@ -2,49 +2,44 @@ 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')),
+ contentPath: path.join(__dirname, 'content', 'Leaves of Grass by Walt Whitman.epub'),
+ torrentPath: path.join(__dirname, 'torrents', 'leaves.torrent'),
+ content: fs.readFileSync(path.join(__dirname, 'content', 'Leaves of Grass by Walt Whitman.epub')),
+ torrent: fs.readFileSync(path.join(__dirname, 'torrents', 'leaves.torrent')),
parsedTorrent: parseTorrent(
- fs.readFileSync(path.join(torrents, 'leaves.torrent'))
+ fs.readFileSync(path.join(__dirname, 'torrents', 'leaves.torrent'))
),
magnetURI: parseTorrent.toMagnetURI(parseTorrent(
- fs.readFileSync(path.join(torrents, 'leaves.torrent'))
+ fs.readFileSync(path.join(__dirname, 'torrents', 'leaves.torrent'))
))
},
// Folder which contains single file
folder: {
- contentPath: path.join(content, 'folder'),
- torrentPath: path.join(torrents, 'folder.torrent'),
- torrent: fs.readFileSync(path.join(torrents, 'folder.torrent')),
+ contentPath: path.join(__dirname, 'content', 'folder'),
+ torrentPath: path.join(__dirname, 'torrents', 'folder.torrent'),
+ torrent: fs.readFileSync(path.join(__dirname, 'torrents', 'folder.torrent')),
parsedTorrent: parseTorrent(
- fs.readFileSync(path.join(torrents, 'folder.torrent'))
+ fs.readFileSync(path.join(__dirname, 'torrents', 'folder.torrent'))
),
magnetURI: parseTorrent.toMagnetURI(parseTorrent(
- fs.readFileSync(path.join(torrents, 'folder.torrent'))
+ fs.readFileSync(path.join(__dirname, 'torrents', 'folder.torrent'))
))
},
// Folder which contains multiple files
numbers: {
- contentPath: path.join(content, 'numbers'),
- torrentPath: path.join(torrents, 'numbers.torrent'),
- torrent: fs.readFileSync(path.join(torrents, 'numbers.torrent')),
+ contentPath: path.join(__dirname, 'content', 'numbers'),
+ torrentPath: path.join(__dirname, 'torrents', 'numbers.torrent'),
+ torrent: fs.readFileSync(path.join(__dirname, 'torrents', 'numbers.torrent')),
parsedTorrent: parseTorrent(
- fs.readFileSync(path.join(torrents, 'numbers.torrent'))
+ fs.readFileSync(path.join(__dirname, 'torrents', 'numbers.torrent'))
),
magnetURI: parseTorrent.toMagnetURI(parseTorrent(
- fs.readFileSync(path.join(torrents, 'numbers.torrent'))
+ fs.readFileSync(path.join(__dirname, 'torrents', 'numbers.torrent'))
))
}
}