From f016bdbc35b7efa44bd63413bde09433ea916c59 Mon Sep 17 00:00:00 2001 From: HumairAK Date: Tue, 26 Jul 2016 03:43:04 -0400 Subject: added some unit testing, need a lot more --- node_modules/mocha/bin/options.js | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 node_modules/mocha/bin/options.js (limited to 'node_modules/mocha/bin/options.js') 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; +} -- cgit v1.2.3