From 1892cfc29ba5360a135296b1bed451d67eead3ae Mon Sep 17 00:00:00 2001 From: juergba Date: Sat, 20 Jul 2019 18:26:22 +0200 Subject: [PATCH 1/3] remove deprecated getOptions() --- lib/cli/options.js | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/lib/cli/options.js b/lib/cli/options.js index a88dbfbf17..7cd2e48289 100644 --- a/lib/cli/options.js +++ b/lib/cli/options.js @@ -15,7 +15,6 @@ const mocharc = require('../mocharc.json'); const {list} = require('./run-helpers'); const {loadConfig, findConfig} = require('./config'); const findUp = require('find-up'); -const {deprecate} = require('../utils'); const debug = require('debug')('mocha:cli:options'); const {isNodeFlag} = require('./node-flags'); @@ -163,40 +162,6 @@ const parseMochaOpts = content => .filter(Boolean) .map(value => value.replace(/%20/g, ' ')); -/** - * Prepends options from run-control file to the command line arguments. - * - * @deprecated Deprecated in v6.0.0; This function is no longer used internally and will be removed in a future version. - * @public - * @alias module:lib/cli/options - * @see {@link https://mochajs.org/#mochaopts|mocha.opts} - */ -module.exports = function getOptions() { - deprecate( - 'getOptions() is DEPRECATED and will be removed from a future version of Mocha. Use loadOptions() instead' - ); - if (process.argv.length === 3 && ONE_AND_DONE_ARGS.has(process.argv[2])) { - return; - } - - const optsPath = - process.argv.indexOf('--opts') === -1 - ? mocharc.opts - : process.argv[process.argv.indexOf('--opts') + 1]; - - try { - const options = parseMochaOpts(fs.readFileSync(optsPath, 'utf8')); - - process.argv = process.argv - .slice(0, 2) - .concat(options.concat(process.argv.slice(2))); - } catch (ignore) { - // NOTE: should console.error() and throw the error - } - - process.env.LOADED_MOCHA_OPTS = true; -}; - /** * Given filepath in `args.opts`, attempt to load and parse a `mocha.opts` file. * @param {Object} [args] - Arguments object From bc4a407af3a0cbc47f422803a5bc9ea1abe25b39 Mon Sep 17 00:00:00 2001 From: juergba Date: Sat, 20 Jul 2019 19:03:04 +0200 Subject: [PATCH 2/3] remove deprecated "bin/options.js" --- bin/options.js | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 bin/options.js diff --git a/bin/options.js b/bin/options.js deleted file mode 100644 index 102fd5a9c1..0000000000 --- a/bin/options.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -/* - * This module is deprecated and will be removed in a future version of Mocha. - * @deprecated Deprecated in v6.0.0; source moved into {@link module:lib/cli/options lib/cli/options module}. - * @module - * @exports module:lib/cli/options - */ - -module.exports = require('../lib/cli/options'); From 2ae1f7249c303b38a85f7905535a3f428f2b4cd0 Mon Sep 17 00:00:00 2001 From: juergba Date: Thu, 15 Aug 2019 18:31:42 +0200 Subject: [PATCH 3/3] adapt "files" in package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d33830d39a..07b81c9c7d 100644 --- a/package.json +++ b/package.json @@ -596,7 +596,7 @@ "watchify": "^3.11.1" }, "files": [ - "bin/{*mocha,options.js}", + "bin/*mocha", "assets/growl/*.png", "lib/**/*.{js,html,json}", "index.js",