aboutsummaryrefslogtreecommitdiff
path: root/node_modules/mocha/bin/options.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-10-10 03:43:44 +0200
committerFlorian Dold <florian.dold@gmail.com>2016-10-10 03:43:44 +0200
commitabd94a7f5a50f43c797a11b53549ae48fff667c3 (patch)
treeab8ed457f65cdd72e13e0571d2975729428f1551 /node_modules/mocha/bin/options.js
parenta0247c6a3fd6a09a41a7e35a3441324c4dcb58be (diff)
add node_modules to address #4364
Diffstat (limited to 'node_modules/mocha/bin/options.js')
-rw-r--r--node_modules/mocha/bin/options.js39
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 000000000..9d1a18a23
--- /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;
+}