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:
authorAlex <alxmorais8@msn.com>2019-08-12 16:52:33 +0300
committerAlex <alxmorais8@msn.com>2019-08-12 16:52:33 +0300
commit3ddb63c874c7ea24f27ff521f0ceef818f92084f (patch)
tree3e3b47725aacf9df4e7c2b3336800e6ce0cddee9 /test
parent35fc44f9b98d6970244a517a5a9ca6175a3b40f5 (diff)
Small refactor common test function
Diffstat (limited to 'test')
-rw-r--r--test/common.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/common.js b/test/common.js
index 8c30686..6f2ce1e 100644
--- a/test/common.js
+++ b/test/common.js
@@ -3,11 +3,11 @@ const fs = require('fs')
const path = require('path')
exports.getDownloadPath = function (infix, infoHash) {
- let downloadPath
+ let tmpPath
try {
- downloadPath = path.join(fs.statSync('/tmp') && '/tmp', 'webtorrent', 'test')
+ tmpPath = path.join(fs.statSync('/tmp') && '/tmp')
} catch (err) {
- downloadPath = path.join(typeof os.tmpdir === 'function' ? os.tmpdir() : '/', 'webtorrent', 'test')
+ tmpPath = path.join(typeof os.tmpdir === 'function' ? os.tmpdir() : '/')
}
- return path.join(downloadPath, infix, infoHash)
+ return path.join(tmpPath, 'webtorrent', 'test', infix, infoHash)
}