diff options
| author | nanalelfe <nargiza.nosirova@mail.utoronto.ca> | 2016-07-27 00:03:48 +0000 |
|---|---|---|
| committer | nanalelfe <nargiza.nosirova@mail.utoronto.ca> | 2016-07-27 00:03:48 +0000 |
| commit | 714368c049f8749ed22c6d1d07bb3adc783dc349 (patch) | |
| tree | 8952248ebf3f85b141ef0d18ecf6a1becdc8b89b /node_modules/mocha/bin/options.js | |
| parent | 8beb37ed67b5f2fa0f9aa85499a8f11b39c9d067 (diff) | |
| parent | b65166302f5296165da115ed96ce112433157a2d (diff) | |
Merge branch 'master' of https://github.com/HumairAK/solutions_repo
Diffstat (limited to 'node_modules/mocha/bin/options.js')
| -rw-r--r-- | node_modules/mocha/bin/options.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/node_modules/mocha/bin/options.js b/node_modules/mocha/bin/options.js new file mode 100644 index 0000000..9d1a18a --- /dev/null +++ b/node_modules/mocha/bin/options.js @@ -0,0 +1,39 @@ +/** + * Dependencies. + */ + +var fs = require('fs'); + +/** + * Export `getOptions`. + */ + +module.exports = getOptions; + +/** + * Get options. + */ + +function getOptions() { + var optsPath = process.argv.indexOf('--opts') !== -1 + ? process.argv[process.argv.indexOf('--opts') + 1] + : 'test/mocha.opts'; + + try { + var opts = fs.readFileSync(optsPath, 'utf8') + .replace(/\\\s/g, '%20') + .split(/\s/) + .filter(Boolean) + .map(function(value) { + return value.replace(/%20/g, ' '); + }); + + process.argv = process.argv + .slice(0, 2) + .concat(opts.concat(process.argv.slice(2))); + } catch (err) { + // ignore + } + + process.env.LOADED_MOCHA_OPTS = true; +} |
