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:
authorAlex <alxmorais8@msn.com>2019-08-12 15:06:27 +0300
committerAlex <alxmorais8@msn.com>2019-08-12 15:06:27 +0300
commit26dcc3fb29e3d9fa4b94fe195aae7ba028684178 (patch)
treec9c8cf0a4d48bac01b159dfe004e099cf3759715 /test/common.js
parentcd43d50b15e17abd575b2aa1ac0b07010c84324d (diff)
Fix left parameter for asynchronous behaviour
Diffstat (limited to 'test/common.js')
-rw-r--r--test/common.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/common.js b/test/common.js
new file mode 100644
index 0000000..9ac99a1
--- /dev/null
+++ b/test/common.js
@@ -0,0 +1,13 @@
+const os = require('os')
+const fs = require('fs')
+const path = require('path')
+
+exports.getTestPath = function (infix, infoHash) {
+ let testPath
+ try {
+ testPath = path.join(fs.statSync('/tmp') && '/tmp', 'webtorrent', 'test')
+ } catch (err) {
+ testPath = path.join(typeof os.tmpdir === 'function' ? os.tmpdir() : '/', 'webtorrent', 'test')
+ }
+ return path.join(testPath, infix, infoHash)
+}