diff options
author | Alex <alxmorais8@msn.com> | 2019-08-12 16:41:54 +0300 |
---|---|---|
committer | Alex <alxmorais8@msn.com> | 2019-08-12 16:41:54 +0300 |
commit | 35fc44f9b98d6970244a517a5a9ca6175a3b40f5 (patch) | |
tree | 028150c3d01ccc35757dcb815eefeb5dff09cb15 /test/common.js | |
parent | 26dcc3fb29e3d9fa4b94fe195aae7ba028684178 (diff) |
Rename util function for tests
Diffstat (limited to 'test/common.js')
-rw-r--r-- | test/common.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/common.js b/test/common.js index 9ac99a1..8c30686 100644 --- a/test/common.js +++ b/test/common.js @@ -2,12 +2,12 @@ const os = require('os') const fs = require('fs') const path = require('path') -exports.getTestPath = function (infix, infoHash) { - let testPath +exports.getDownloadPath = function (infix, infoHash) { + let downloadPath try { - testPath = path.join(fs.statSync('/tmp') && '/tmp', 'webtorrent', 'test') + downloadPath = path.join(fs.statSync('/tmp') && '/tmp', 'webtorrent', 'test') } catch (err) { - testPath = path.join(typeof os.tmpdir === 'function' ? os.tmpdir() : '/', 'webtorrent', 'test') + downloadPath = path.join(typeof os.tmpdir === 'function' ? os.tmpdir() : '/', 'webtorrent', 'test') } - return path.join(testPath, infix, infoHash) + return path.join(downloadPath, infix, infoHash) } |