diff options
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/utils.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/helpers/utils.js b/server/helpers/utils.js index 9c2d402e3..9f27671b6 100644 --- a/server/helpers/utils.js +++ b/server/helpers/utils.js | |||
@@ -6,7 +6,8 @@ const logger = require('./logger') | |||
6 | 6 | ||
7 | const utils = { | 7 | const utils = { |
8 | cleanForExit, | 8 | cleanForExit, |
9 | generateRandomString | 9 | generateRandomString, |
10 | isTestInstance | ||
10 | } | 11 | } |
11 | 12 | ||
12 | function generateRandomString (size, callback) { | 13 | function generateRandomString (size, callback) { |
@@ -22,6 +23,10 @@ function cleanForExit (webtorrentProcess) { | |||
22 | process.kill(-webtorrentProcess.pid) | 23 | process.kill(-webtorrentProcess.pid) |
23 | } | 24 | } |
24 | 25 | ||
26 | function isTestInstance () { | ||
27 | return (process.env.NODE_ENV === 'test') | ||
28 | } | ||
29 | |||
25 | // --------------------------------------------------------------------------- | 30 | // --------------------------------------------------------------------------- |
26 | 31 | ||
27 | module.exports = utils | 32 | module.exports = utils |