Skip to content

Commit

Permalink
soft deprecate configuration via mocha.opts
Browse files Browse the repository at this point in the history
  • Loading branch information
juergba committed Jul 21, 2019
1 parent 1e6cf3b commit 23088d9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/cli/options.js
Expand Up @@ -200,7 +200,7 @@ module.exports = function getOptions() {
/**
* Given filepath in `args.opts`, attempt to load and parse a `mocha.opts` file.
* @param {Object} [args] - Arguments object
* @param {string|boolean} [args.opts] - Filepath to mocha.opts; defaults to whatever's in `mocharc.opts`, or `false` to skip
* @param {string|boolean} [args.opts] - Filepath to mocha.opts; defaults to whatever's in `mocharc.json`, or `false` to skip
* @returns {external:yargsParser.Arguments|void} If read, object containing parsed arguments
* @memberof module:lib/cli/options
* @public
Expand Down Expand Up @@ -230,6 +230,9 @@ const loadMochaOpts = (args = {}) => {
// if there's an exception to catch here, I'm not sure what it is.
// by attaching the `no-opts` arg, we avoid re-parsing of `mocha.opts`.
if (mochaOpts) {
deprecate(
'Configuration via mocha.opts is DEPRECATED and will be removed from a future version of Mocha. Use RC files or package.json instead.'
);
result = parse(parseMochaOpts(mochaOpts));
debug(`${filepath} parsed succesfully`);
}
Expand Down

0 comments on commit 23088d9

Please sign in to comment.