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:
authorJoseph Frazier <joseph@onsip.com>2015-10-04 23:29:28 +0300
committerJoseph Frazier <joseph@onsip.com>2015-10-04 23:31:37 +0300
commitb3055504fffc1990f2d0745655da690ae23ff05b (patch)
treed23088eba2ff25d03528e6785a16b9629451d06c /test/basic-node.js
parenta0d212c8882fb5dbbeabc27b861e79980b6dd52e (diff)
Use path.resolve in tests
See https://github.com/feross/webtorrent/issues/429#issuecomment-139878312
Diffstat (limited to 'test/basic-node.js')
-rw-r--r--test/basic-node.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/basic-node.js b/test/basic-node.js
index 494dace..cc093ec 100644
--- a/test/basic-node.js
+++ b/test/basic-node.js
@@ -1,16 +1,17 @@
var WebTorrent = require('../')
var fs = require('fs')
var http = require('http')
+var path = require('path')
var parseTorrent = require('parse-torrent')
var test = require('tape')
-var leavesPath = __dirname + '/torrents/leaves.torrent'
+var leavesPath = path.resolve(__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 leavesBookPath = path.resolve(__dirname, 'content', 'Leaves of Grass by Walt Whitman.epub')
var leavesMagnetURI = 'magnet:?xt=urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36&dn=Leaves+of+Grass+by+Walt+Whitman.epub&tr=http%3A%2F%2Ftracker.bittorrent.am%2Fannounce&tr=http%3A%2F%2Ftracker.thepiratebay.org%2Fannounce&tr=udp%3A%2F%2Ffr33domtracker.h33t.com%3A3310%2Fannounce&tr=udp%3A%2F%2Ftracker.ccc.de%3A80&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80'
-var numbersPath = __dirname + '/content/numbers'
-var folderPath = __dirname + '/content/folder'
+var numbersPath = path.resolve(__dirname, 'content', 'numbers')
+var folderPath = path.resolve(__dirname, 'content', 'folder')
test('client.add: http url to a torrent file, string', function (t) {
t.plan(3)