From c7f5e882b6ff14f0959340396072379b0319f00c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulises=20Gasc=C3=B3n?= Date: Thu, 12 Mar 2020 15:08:29 +0100 Subject: [PATCH 001/192] Drop node.js v8 support (#4164) --- .eslintrc.yml | 4 ++-- .github/CONTRIBUTING.md | 2 +- .travis.yml | 6 ------ appveyor.yml | 1 - docs/README.md | 2 +- docs/index.md | 2 +- package.json | 2 +- 7 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.eslintrc.yml b/.eslintrc.yml index 96f28ebb9f..34c77cabe4 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -28,7 +28,7 @@ overrides: - test/integration/helpers.js - lib/growl.js parserOptions: - ecmaVersion: 2017 + ecmaVersion: 2018 env: browser: false - files: @@ -83,7 +83,7 @@ overrides: - files: - test/**/*.mjs parserOptions: - ecmaVersion: 2017 + ecmaVersion: 2018 sourceType: module - files: diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 027a7f9647..4614aa046e 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -42,7 +42,7 @@ Follow these steps to get going. If you are having trouble, don't be afraid to [ > PRO TIP: After `npm install`, run `npm start` to see a list of commands which can be run with `npm start ` (powered by [nps](https://npm.im/nps)). -1. [Install Node.js 8.x or newer](https://nodejs.org/en/download/). +1. [Install Node.js 10.x or newer](https://nodejs.org/en/download/). - If you're new to installing Node, a tool like [nvm](https://github.com/creationix/nvm#install-script) can help you manage multiple version installations. - You will need [Google Chrome](https://www.google.com/chrome/) to run browser-based tests locally. 1. Follow [Github's documentation](https://help.github.com/articles/fork-a-repo/) on setting up Git, forking and cloning. diff --git a/.travis.yml b/.travis.yml index adc8c5e874..26976b9cd7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,9 +46,6 @@ jobs: - <<: *node node_js: '10' - - <<: *node - node_js: '8' - - script: npm start test.bundle test.browser # XXX: update when canvas supplies a prebuilt binary for Node.js v12.x node_js: 10 @@ -83,9 +80,6 @@ jobs: - <<: *smoke node_js: '10' - - <<: *smoke - node_js: '8' - - stage: precache script: true diff --git a/appveyor.yml b/appveyor.yml index 821ef90349..af8559d76f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,7 +15,6 @@ environment: - nodejs_version: '13' - nodejs_version: '12' - nodejs_version: '10' - - nodejs_version: '8' matrix: fast_finish: true install: diff --git a/docs/README.md b/docs/README.md index b9f8da6d45..0aeef4d5ca 100644 --- a/docs/README.md +++ b/docs/README.md @@ -6,7 +6,7 @@ _So you wanna build the site?_ ## Prerequisites -- Node.js v8.x or greater +- Node.js v10.x or greater ## Development diff --git a/docs/index.md b/docs/index.md index 1a67af108a..1ef8793f96 100644 --- a/docs/index.md +++ b/docs/index.md @@ -99,7 +99,7 @@ or as a development dependency for your project: $ npm install --save-dev mocha ``` -> As of v7.0.0, Mocha requires Node.js v8.0.0 or newer. +> As of v8.0.0, Mocha requires Node.js v10.0.0 or newer. ## Getting Started diff --git a/package.json b/package.json index 4c48449d4c..a3de8e44af 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "test": "./test" }, "engines": { - "node": ">= 8.0.0" + "node": ">= 10.0.0" }, "scripts": { "prepublishOnly": "nps test clean build", From 6aeeb33908a5fa8f02e90676273ea40e65d8ddc6 Mon Sep 17 00:00:00 2001 From: kundol Date: Thu, 12 Mar 2020 23:45:27 +0900 Subject: [PATCH 002/192] Remove deprecated methods in mocha.js (#4178) Remove following methods and cleanup. - Mocha.prototype.ignoreLeaks - Mocha.prototype.useColors - Mocha.prototype.useInlineDiffs - Mocha.prototype.hideDiff --- lib/mocha.js | 71 ------------------------------- test/jsapi/index.js | 1 - test/unit/mocha.spec.js | 94 ----------------------------------------- 3 files changed, 166 deletions(-) diff --git a/lib/mocha.js b/lib/mocha.js index 740e1fd841..017daa1e2c 100644 --- a/lib/mocha.js +++ b/lib/mocha.js @@ -474,24 +474,6 @@ Mocha.prototype.invert = function() { return this; }; -/** - * Enables or disables ignoring global leaks. - * - * @deprecated since v7.0.0 - * @public - * @see {@link Mocha#checkLeaks} - * @param {boolean} [ignoreLeaks=false] - Whether to ignore global leaks. - * @return {Mocha} this - * @chainable - */ -Mocha.prototype.ignoreLeaks = function(ignoreLeaks) { - utils.deprecate( - '"ignoreLeaks()" is DEPRECATED, please use "checkLeaks()" instead.' - ); - this.options.checkLeaks = !ignoreLeaks; - return this; -}; - /** * Enables or disables checking for global variables leaked while running tests. * @@ -589,24 +571,6 @@ Mocha.prototype.global = function(global) { // for backwards compability, 'globals' is an alias of 'global' Mocha.prototype.globals = Mocha.prototype.global; -/** - * Enables or disables TTY color output by screen-oriented reporters. - * - * @deprecated since v7.0.0 - * @public - * @see {@link Mocha#color} - * @param {boolean} colors - Whether to enable color output. - * @return {Mocha} this - * @chainable - */ -Mocha.prototype.useColors = function(colors) { - utils.deprecate('"useColors()" is DEPRECATED, please use "color()" instead.'); - if (colors !== undefined) { - this.options.color = colors; - } - return this; -}; - /** * Enables or disables TTY color output by screen-oriented reporters. * @@ -621,25 +585,6 @@ Mocha.prototype.color = function(color) { return this; }; -/** - * Determines if reporter should use inline diffs (rather than +/-) - * in test failure output. - * - * @deprecated since v7.0.0 - * @public - * @see {@link Mocha#inlineDiffs} - * @param {boolean} [inlineDiffs=false] - Whether to use inline diffs. - * @return {Mocha} this - * @chainable - */ -Mocha.prototype.useInlineDiffs = function(inlineDiffs) { - utils.deprecate( - '"useInlineDiffs()" is DEPRECATED, please use "inlineDiffs()" instead.' - ); - this.options.inlineDiffs = inlineDiffs !== undefined && inlineDiffs; - return this; -}; - /** * Enables or disables reporter to use inline diffs (rather than +/-) * in test failure output. @@ -655,22 +600,6 @@ Mocha.prototype.inlineDiffs = function(inlineDiffs) { return this; }; -/** - * Determines if reporter should include diffs in test failure output. - * - * @deprecated since v7.0.0 - * @public - * @see {@link Mocha#diff} - * @param {boolean} [hideDiff=false] - Whether to hide diffs. - * @return {Mocha} this - * @chainable - */ -Mocha.prototype.hideDiff = function(hideDiff) { - utils.deprecate('"hideDiff()" is DEPRECATED, please use "diff()" instead.'); - this.options.diff = !(hideDiff === true); - return this; -}; - /** * Enables or disables reporter to include diff in test failure output. * diff --git a/test/jsapi/index.js b/test/jsapi/index.js index 231c52fedf..1aa842eb08 100644 --- a/test/jsapi/index.js +++ b/test/jsapi/index.js @@ -5,7 +5,6 @@ var Mocha = require('../../'); var mocha = new Mocha({ ui: 'bdd', globals: ['okGlobalA', 'okGlobalB', 'okGlobalC', 'callback*'], - // ignoreLeaks: true, growl: true }); diff --git a/test/unit/mocha.spec.js b/test/unit/mocha.spec.js index bc460aa845..a317ca7c39 100644 --- a/test/unit/mocha.spec.js +++ b/test/unit/mocha.spec.js @@ -332,56 +332,6 @@ describe('Mocha', function() { }); }); - describe('#hideDiff()', function() { - it('should set the diff option to false when param equals true', function() { - var mocha = new Mocha(opts); - mocha.hideDiff(true); - expect(mocha.options, 'to have property', 'diff', false); - }); - - it('should set the diff option to true when param equals false', function() { - var mocha = new Mocha(opts); - mocha.hideDiff(false); - expect(mocha.options, 'to have property', 'diff', true); - }); - - it('should set the diff option to true when the param is undefined', function() { - var mocha = new Mocha(opts); - mocha.hideDiff(); - expect(mocha.options, 'to have property', 'diff', true); - }); - - it('should be chainable', function() { - var mocha = new Mocha(opts); - expect(mocha.hideDiff(), 'to be', mocha); - }); - }); - - describe('#ignoreLeaks()', function() { - it('should set the checkLeaks option to false when param equals true', function() { - var mocha = new Mocha(opts); - mocha.ignoreLeaks(true); - expect(mocha.options, 'to have property', 'checkLeaks', false); - }); - - it('should set the checkLeaks option to true when param equals false', function() { - var mocha = new Mocha(opts); - mocha.ignoreLeaks(false); - expect(mocha.options, 'to have property', 'checkLeaks', true); - }); - - it('should set the checkLeaks option to true when the param is undefined', function() { - var mocha = new Mocha(opts); - mocha.ignoreLeaks(); - expect(mocha.options, 'to have property', 'checkLeaks', true); - }); - - it('should be chainable', function() { - var mocha = new Mocha(opts); - expect(mocha.ignoreLeaks(), 'to be', mocha); - }); - }); - describe('#inlineDiffs()', function() { it('should set the inlineDiffs option to true', function() { var mocha = new Mocha(opts); @@ -512,48 +462,4 @@ describe('Mocha', function() { }); }); }); - - describe('#useColors()', function() { - it('should set the color option to true', function() { - var mocha = new Mocha(opts); - mocha.useColors(true); - expect(mocha.options, 'to have property', 'color', true); - }); - - it('should not create the color property', function() { - var mocha = new Mocha(opts); - mocha.useColors(); - expect(mocha.options, 'not to have property', 'color'); - }); - - it('should be chainable', function() { - var mocha = new Mocha(opts); - expect(mocha.useColors(), 'to be', mocha); - }); - }); - - describe('#useInlineDiffs()', function() { - it('should set the inlineDiffs option to true when param equals true', function() { - var mocha = new Mocha(opts); - mocha.useInlineDiffs(true); - expect(mocha.options, 'to have property', 'inlineDiffs', true); - }); - - it('should set the inlineDiffs option to false when param equals false', function() { - var mocha = new Mocha(opts); - mocha.useInlineDiffs(false); - expect(mocha.options, 'to have property', 'inlineDiffs', false); - }); - - it('should set the inlineDiffs option to false when the param is undefined', function() { - var mocha = new Mocha(opts); - mocha.useInlineDiffs(); - expect(mocha.options, 'to have property', 'inlineDiffs', false); - }); - - it('should be chainable', function() { - var mocha = new Mocha(opts); - expect(mocha.useInlineDiffs(), 'to be', mocha); - }); - }); }); From 2f264784d22277efa99244a8615ce2a1830b2d3c Mon Sep 17 00:00:00 2001 From: Juerg B <44573692+juergba@users.noreply.github.com> Date: Thu, 12 Mar 2020 17:20:37 +0100 Subject: [PATCH 003/192] Remove configuration via 'mocha.opts' (#4175) --- docs/index.md | 54 +--- example/config/.mocharc.js | 1 - example/config/.mocharc.json | 1 - example/config/.mocharc.jsonc | 1 - example/config/.mocharc.yml | 1 - lib/cli/config.js | 1 - lib/cli/options.js | 89 +------ lib/cli/run-option-metadata.js | 1 - lib/cli/run.js | 14 +- lib/mocharc.json | 1 - package-scripts.js | 11 +- .../fixtures/options/help/test/mocha.opts | 1 - .../fixtures/options/opts.fixture.js | 5 - test/integration/options/help.spec.js | 26 -- test/integration/options/opts.spec.js | 57 +--- test/node-unit/cli/options.spec.js | 245 ++---------------- test/opts/mocha.opts | 10 - test/opts/opts.spec.js | 11 - 18 files changed, 42 insertions(+), 488 deletions(-) delete mode 100644 test/integration/fixtures/options/help/test/mocha.opts delete mode 100644 test/integration/fixtures/options/opts.fixture.js delete mode 100644 test/integration/options/help.spec.js delete mode 100644 test/opts/mocha.opts delete mode 100644 test/opts/opts.spec.js diff --git a/docs/index.md b/docs/index.md index 1ef8793f96..898d8f1de5 100644 --- a/docs/index.md +++ b/docs/index.md @@ -36,7 +36,6 @@ Mocha is a feature-rich JavaScript test framework running on [Node.js][] and in - [auto-exit to prevent "hanging" with an active loop](#-exit) - [easily meta-generate suites](#markdown) & [test-cases](#list) - [config file support](#-config-path) -- [mocha.opts file support](#-opts-path) - clickable suite titles to filter test execution - [node debugger support](#-inspect-inspect-brk-inspect) - [node native ES modules support](#nodejs-native-esm-support) @@ -75,7 +74,6 @@ Mocha is a feature-rich JavaScript test framework running on [Node.js][] and in - [Running Mocha in the Browser](#running-mocha-in-the-browser) - [Desktop Notification Support](#desktop-notification-support) - [Configuring Mocha (Node.js)](#configuring-mocha-nodejs) -- [`mocha.opts`](#mochaopts) - [The `test/` Directory](#the-test-directory) - [Error Codes](#error-codes) - [Editor Plugins](#editor-plugins) @@ -865,8 +863,6 @@ Reporting & Output Configuration --config Path to config file [string] [default: (nearest rc file)] - --opts Path to `mocha.opts` (DEPRECATED) - [string] [default: "./test/mocha.opts"] --package Path to package.json for config [string] File Handling @@ -1070,11 +1066,7 @@ By default, Mocha will search for a config file if `--config` is not specified; ### `--opts ` -> _Deprecated in v7.0.0._ - -Specify a path to [`mocha.opts`](#mochaopts). - -By default, Mocha looks for a `mocha.opts` in `test/mocha.opts`; use `--no-opts` to suppress this behavior. +> _Removed in v8.0.0. Please use [configuration file](#configuring-mocha-nodejs) instead._ ### `--package ` @@ -1738,7 +1730,7 @@ tests as shown below: > _New in v6.0.0_ -In addition to supporting the deprecated [`mocha.opts`](#mochaopts) run-control format, Mocha now supports configuration files, typical of modern command-line tools, in several formats: +Mocha supports configuration files, typical of modern command-line tools, in several formats: - **JavaScript**: Create a `.mocharc.js` (or `mocharc.cjs` when using [`"type"="module"`](#nodejs-native-esm-support) in your `package.json`) in your project's root directory, and export an object (`module.exports = {/* ... */}`) containing your configuration. @@ -1746,8 +1738,6 @@ In addition to supporting the deprecated [`mocha.opts`](#mochaopts) run-control - **JSON**: Create a `.mocharc.json` (or `.mocharc.jsonc`) in your project's root directory. Comments — while not valid JSON — are allowed in this file, and will be ignored by Mocha. - **package.json**: Create a `mocha` property in your project's `package.json`. -Mocha suggests using one of the above strategies for configuration instead of the deprecated `mocha.opts` format. - ### Custom Locations You can specify a custom location for your configuration file with the `--config ` option. Mocha will use the file's extension to determine how to parse the file, and will assume JSON if unknown. @@ -1770,12 +1760,11 @@ If no custom path was given, and if there are multiple configuration files in th ### Merging -Mocha will also _merge_ any options found in `package.json` _and_ `mocha.opts` into its run-time configuration. In case of conflict, the priority is: +Mocha will also _merge_ any options found in `package.json` into its run-time configuration. In case of conflict, the priority is: 1. Arguments specified on command-line 1. Configuration file (`.mocharc.js`, `.mocharc.yml`, etc.) 1. `mocha` property of `package.json` -1. `mocha.opts` Options which can safely be repeated (e.g., `--require`) will be _concatenated_, with higher-priorty configuration sources appearing earlier in the list. For example, a `.mocharc.json` containing `"require": "bar"`, coupled with execution of `mocha --require foo`, would cause Mocha to require `foo`, then `bar`, in that order. @@ -1790,45 +1779,10 @@ Configurations can inherit from other modules using the `extends` keyword. See [ - For options containing a dash (`-`), the option name can be specified using camelCase. - Aliases are valid names, e.g., `R` instead of `reporter`. - Test files can be specified using `spec`, e.g., `"spec": "test/**/*.spec.js"`. -- Flags to `node` are _also_ supported in configuration files, like in `mocha.opts`. Use caution, as these can vary between versions of Node.js! +- Flags to `node` are _also_ supported in configuration files. Use caution, as these can vary between versions of Node.js! **For more configuration examples, see the [`example/config`][example-mocha-config] directory on GitHub.** -## `mocha.opts` - -> _`mocha.opts` file support is DEPRECATED and will be removed from a future version of Mocha. We recommend using a configuration file instead._ - -Mocha will attempt to load `"./test/mocha.opts"` as a run-control file of sorts. - -Beginning-of-line comment support is available; any line _starting_ with a -hash (`#`) symbol will be considered a comment. Blank lines may also be used. -Any other line will be treated as a command-line argument (along with any -associated option value) to be used as a default setting. Settings should be -specified one per line. - -The lines in this file are prepended to any actual command-line arguments. -As such, actual command-line arguments will take precedence over the defaults. - -For example, suppose you have the following `mocha.opts` file: - -```bash -# mocha.opts - --require should - --reporter dot - --ui bdd -``` - -The settings above will default the reporter to `dot`, require the `should` -library, and use `bdd` as the interface. With this, you may then invoke `mocha` -with additional arguments, here changing the reporter to `list` and setting the -slow threshold to half a second: - -```bash -$ mocha --reporter list --slow 500 -``` - -To ignore your `mocha.opts`, use the `--no-opts` option. - ## The `test/` Directory By default, `mocha` looks for the glob `"./test/*.js"`, so you may want to put diff --git a/example/config/.mocharc.js b/example/config/.mocharc.js index 671520cd53..46d4e9de1b 100644 --- a/example/config/.mocharc.js +++ b/example/config/.mocharc.js @@ -7,7 +7,6 @@ module.exports = { diff: true, extension: ['js'], - opts: false, package: './package.json', reporter: 'spec', slow: 75, diff --git a/example/config/.mocharc.json b/example/config/.mocharc.json index 43a83e6b0f..fd71460f9a 100644 --- a/example/config/.mocharc.json +++ b/example/config/.mocharc.json @@ -5,7 +5,6 @@ { "diff": true, "extension": ["js"], - "opts": false, "package": "./package.json", "reporter": "spec", "slow": 75, diff --git a/example/config/.mocharc.jsonc b/example/config/.mocharc.jsonc index 25a40b6821..590bf09607 100644 --- a/example/config/.mocharc.jsonc +++ b/example/config/.mocharc.jsonc @@ -5,7 +5,6 @@ { "diff": true, "extension": ["js"], - "opts": false, "package": /* 📦 */ "./package.json", "reporter": /* 📋 */ "spec", "slow": 75, diff --git a/example/config/.mocharc.yml b/example/config/.mocharc.yml index 226f8184ca..da5a0a0c4f 100644 --- a/example/config/.mocharc.yml +++ b/example/config/.mocharc.yml @@ -28,7 +28,6 @@ ignore: inline-diffs: false # needs to be used with grep or fgrep # invert: false -opts: false recursive: false reporter: spec reporter-option: diff --git a/lib/cli/config.js b/lib/cli/config.js index 24de6cd474..1be9f9c4c0 100644 --- a/lib/cli/config.js +++ b/lib/cli/config.js @@ -2,7 +2,6 @@ /** * Responsible for loading / finding Mocha's "rc" files. - * This doesn't have anything to do with `mocha.opts`. * * @private * @module diff --git a/lib/cli/options.js b/lib/cli/options.js index 9fbc22ca0b..9f9f988e70 100644 --- a/lib/cli/options.js +++ b/lib/cli/options.js @@ -2,7 +2,7 @@ /** * Main entry point for handling filesystem-based configuration, - * whether that's `mocha.opts` or a config file or `package.json` or whatever. + * whether that's a config file or `package.json` or whatever. * @module */ @@ -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'); @@ -143,71 +142,6 @@ const parse = (args = [], defaultValues = {}, ...configObjects) => { return result.argv; }; -/** - * - Replaces comments with empty strings - * - Replaces escaped spaces (e.g., 'xxx\ yyy') with HTML space - * - Splits on whitespace, creating array of substrings - * - Filters empty string elements from array - * - Replaces any HTML space with space - * @summary Parses options read from run-control file. - * @private - * @param {string} content - Content read from run-control file. - * @returns {string[]} cmdline options (and associated arguments) - * @ignore - */ -const parseMochaOpts = content => - content - .replace(/^#.*$/gm, '') - .replace(/\\\s/g, '%20') - .split(/\s/) - .filter(Boolean) - .map(value => value.replace(/%20/g, ' ')); - -/** - * 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 - * @returns {external:yargsParser.Arguments|void} If read, object containing parsed arguments - * @memberof module:lib/cli/options - * @see {@link /#mochaopts|mocha.opts} - * @public - */ -const loadMochaOpts = (args = {}) => { - let result; - let filepath = args.opts; - // /dev/null is backwards compat - if (filepath === false || filepath === '/dev/null') { - return result; - } - filepath = filepath || mocharc.opts; - result = {}; - let mochaOpts; - try { - mochaOpts = fs.readFileSync(filepath, 'utf8'); - debug(`read ${filepath}`); - } catch (err) { - if (args.opts) { - throw new Error(`Unable to read ${filepath}: ${err}`); - } - // ignore otherwise. we tried - debug(`No mocha.opts found at ${filepath}`); - } - - // real args should override `mocha.opts` which should override defaults. - // 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`); - } - return result; -}; - -module.exports.loadMochaOpts = loadMochaOpts; - /** * Given path to config file in `args.config`, attempt to load & parse config file. * @param {Object} [args] - Arguments object @@ -267,11 +201,10 @@ module.exports.loadPkgRc = loadPkgRc; * 1. Command-line args * 2. RC file (`.mocharc.c?js`, `.mocharc.ya?ml`, `mocharc.json`) * 3. `mocha` prop of `package.json` - * 4. `mocha.opts` - * 5. default configuration (`lib/mocharc.json`) + * 4. default configuration (`lib/mocharc.json`) * * If a {@link module:lib/cli/one-and-dones.ONE_AND_DONE_ARGS "one-and-done" option} is present in the `argv` array, no external config files will be read. - * @summary Parses options read from `mocha.opts`, `.mocharc.*` and `package.json`. + * @summary Parses options read from `.mocharc.*` and `package.json`. * @param {string|string[]} [argv] - Arguments to parse * @public * @memberof module:lib/cli/options @@ -279,7 +212,7 @@ module.exports.loadPkgRc = loadPkgRc; */ const loadOptions = (argv = []) => { let args = parse(argv); - // short-circuit: look for a flag that would abort loading of mocha.opts + // short-circuit: look for a flag that would abort loading of options if ( Array.from(ONE_AND_DONE_ARGS).reduce( (acc, arg) => acc || arg in args, @@ -291,7 +224,6 @@ const loadOptions = (argv = []) => { const rcConfig = loadRc(args); const pkgConfig = loadPkgRc(args); - const optsConfig = loadMochaOpts(args); if (rcConfig) { args.config = false; @@ -301,19 +233,8 @@ const loadOptions = (argv = []) => { args.package = false; args._ = args._.concat(pkgConfig._ || []); } - if (optsConfig) { - args.opts = false; - args._ = args._.concat(optsConfig._ || []); - } - args = parse( - args._, - mocharc, - args, - rcConfig || {}, - pkgConfig || {}, - optsConfig || {} - ); + args = parse(args._, mocharc, args, rcConfig || {}, pkgConfig || {}); // recombine positional arguments and "spec" if (args.spec) { diff --git a/lib/cli/run-option-metadata.js b/lib/cli/run-option-metadata.js index d0bc92ffbe..4648d9fbfe 100644 --- a/lib/cli/run-option-metadata.js +++ b/lib/cli/run-option-metadata.js @@ -51,7 +51,6 @@ exports.types = { 'config', 'fgrep', 'grep', - 'opts', 'package', 'reporter', 'ui', diff --git a/lib/cli/run.js b/lib/cli/run.js index 014227d569..d024cbb0f2 100644 --- a/lib/cli/run.js +++ b/lib/cli/run.js @@ -163,13 +163,6 @@ exports.builder = yargs => group: GROUPS.OUTPUT, hidden: true }, - opts: { - default: defaults.opts, - description: 'Path to `mocha.opts` (DEPRECATED)', - group: GROUPS.CONFIG, - normalize: true, - requiresArg: true - }, package: { description: 'Path to package.json for config', group: GROUPS.CONFIG, @@ -285,6 +278,13 @@ exports.builder = yargs => ); } + if (argv.opts) { + throw createUnsupportedError( + `--opts: configuring Mocha via 'mocha.opts' is DEPRECATED and no longer supported. + Please use a configuration file instead.` + ); + } + // load requires first, because it can impact "plugin" validation handleRequires(argv.require); validatePlugin(argv, 'reporter', Mocha.reporters); diff --git a/lib/mocharc.json b/lib/mocharc.json index 1ed9157675..51c3fce6a0 100644 --- a/lib/mocharc.json +++ b/lib/mocharc.json @@ -1,7 +1,6 @@ { "diff": true, "extension": ["js", "cjs", "mjs"], - "opts": "./test/mocha.opts", "package": "./package.json", "reporter": "spec", "slow": 75, diff --git a/package-scripts.js b/package-scripts.js index a94de98e40..5e0b1736ef 100644 --- a/package-scripts.js +++ b/package-scripts.js @@ -80,8 +80,7 @@ module.exports = { 'test.node.jsapi', 'test.node.requires', 'test.node.reporters', - 'test.node.only', - 'test.node.opts' + 'test.node.only' ].join(' ')}`, description: 'Run Node.js tests' }, @@ -120,14 +119,6 @@ module.exports = { description: 'Run Node.js integration tests', hiddenFromHelp: true }, - opts: { - script: test( - 'opts', - '--opts test/opts/mocha.opts test/opts/opts.spec.js --no-config' - ), - description: 'Run tests concerning mocha.opts', - hiddenFromHelp: true - }, jsapi: { script: 'node test/jsapi', description: 'Run Node.js Mocha JavaScript API tests', diff --git a/test/integration/fixtures/options/help/test/mocha.opts b/test/integration/fixtures/options/help/test/mocha.opts deleted file mode 100644 index 257cc5642c..0000000000 --- a/test/integration/fixtures/options/help/test/mocha.opts +++ /dev/null @@ -1 +0,0 @@ -foo diff --git a/test/integration/fixtures/options/opts.fixture.js b/test/integration/fixtures/options/opts.fixture.js deleted file mode 100644 index 359dc1302b..0000000000 --- a/test/integration/fixtures/options/opts.fixture.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -describe('opts', function () { - it('should display this spec', function () {}); -}); diff --git a/test/integration/options/help.spec.js b/test/integration/options/help.spec.js deleted file mode 100644 index fe182bce95..0000000000 --- a/test/integration/options/help.spec.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -var path = require('path'); -var helpers = require('../helpers'); -var invokeMocha = helpers.invokeMocha; - -describe('--help', function() { - it('should work despite the presence of "mocha.opts"', function(done) { - var args = ['-h']; - // :NOTE: Must use platform-specific `path.join` for `spawnOpts.cwd` - var fixtureDir = path.join(__dirname, '..', 'fixtures', 'options', 'help'); - var spawnOpts = {cwd: fixtureDir}; - - invokeMocha( - args, - function(err, res) { - if (err) { - return done(err); - } - expect(res.output, 'to contain', 'Run tests with Mocha'); - done(); - }, - spawnOpts - ); - }); -}); diff --git a/test/integration/options/opts.spec.js b/test/integration/options/opts.spec.js index e3d98581ed..30b129f316 100644 --- a/test/integration/options/opts.spec.js +++ b/test/integration/options/opts.spec.js @@ -1,64 +1,23 @@ 'use strict'; -var path = require('path').posix; -var helpers = require('../helpers'); -var runMochaJSON = helpers.runMochaJSON; -var invokeMocha = helpers.invokeMocha; -var resolvePath = helpers.resolveFixturePath; +var invokeMocha = require('../helpers').invokeMocha; describe('--opts', function() { - var args = []; - var fixture = path.join('options', 'opts'); - - it('should print a deprecation warning', function(done) { - var mochaOpts = path.join('test', 'opts', 'mocha.opts'); - args = [resolvePath(fixture), '--opts', mochaOpts]; + it('should report deprecation', function(done) { invokeMocha( - args, + ['--opts', './test/mocha.opts'], function(err, res) { if (err) { return done(err); } - - expect(res, 'to have passed'); - expect(res.output, 'to contain', 'mocha.opts is DEPRECATED'); + expect( + res, + 'to have failed with output', + /'mocha.opts' is DEPRECATED/i + ); done(); }, 'pipe' ); }); - - it('should work despite nonexistent default options file', function(done) { - args = []; - runMochaJSON(fixture, args, function(err, res) { - if (err) { - return done(err); - } - - expect(res, 'to have passed').and('to have passed test count', 1); - done(); - }); - }); - - it('should throw an error due to nonexistent options file', function(done) { - var spawnOpts = {stdio: 'pipe'}; - var nonexistentFile = 'nosuchoptionsfile'; - args = ['--opts', nonexistentFile, resolvePath(fixture)]; - invokeMocha( - args, - function(err, res) { - if (err) { - return done(err); - } - - var pattern = 'unable to read ' + nonexistentFile; - expect(res, 'to satisfy', { - code: 1, - output: new RegExp(pattern, 'i') - }); - done(); - }, - spawnOpts - ); - }); }); diff --git a/test/node-unit/cli/options.spec.js b/test/node-unit/cli/options.spec.js index 84723bafda..d60de8e268 100644 --- a/test/node-unit/cli/options.spec.js +++ b/test/node-unit/cli/options.spec.js @@ -27,7 +27,6 @@ const defaults = { timeout: 1000, timeouts: 1000, t: 1000, - opts: '/default/path/to/mocha.opts', extension: ['js'] }; @@ -54,8 +53,7 @@ describe('options', function() { * 1. Command-line args * 2. RC file (`.mocharc.js`, `.mocharc.ya?ml`, `mocharc.json`) * 3. `mocha` prop of `package.json` - * 4. `mocha.opts` - * 5. default rc + * 4. default rc */ describe('loadOptions()', function() { describe('when no parameter provided', function() { @@ -63,7 +61,6 @@ describe('options', function() { this.timeout(500); readFileSync = sandbox.stub(); readFileSync.onFirstCall().returns('{}'); - readFileSync.onSecondCall().returns('--retries 3'); findConfig = sandbox.stub().returns('/some/.mocharc.json'); loadConfig = sandbox.stub().returns({}); findupSync = sandbox.stub().returns('/some/package.json'); @@ -83,192 +80,13 @@ describe('options', function() { Object.assign({}, defaults, { _: [], config: false, - opts: false, - package: false, - retries: '3' + package: false }) ); }); }); describe('when parameter provided', function() { - describe('mocha.opts', function() { - describe('when path to mocha.opts (`--opts `) is invalid', function() { - describe('when path is not default', function() { - let opts; - - beforeEach(function() { - opts = '/some/other/path/to/mocha.opts'; - readFileSync = sandbox.stub(); - readFileSync.onFirstCall().returns('{}'); - readFileSync.onSecondCall().throws(); - findConfig = sandbox.stub().returns('/some/.mocharc.json'); - loadConfig = sandbox.stub().returns({}); - findupSync = sandbox.stub().returns('/some/package.json'); - - loadOptions = proxyLoadOptions({ - readFileSync, - findConfig, - loadConfig, - findupSync - }); - }); - - it('should attempt to load file at path', function() { - try { - loadOptions(`--opts ${opts}`); - } catch (ignored) {} - expect(readFileSync, 'to have a call satisfying', [opts, 'utf8']); - }); - - it('should throw', function() { - expect( - () => { - loadOptions(`--opts ${opts}`); - }, - 'to throw', - /unable to read/i - ); - }); - }); - - describe('when path to mocha.opts is unspecified', function() { - let result; - - beforeEach(function() { - readFileSync = sandbox.stub(); - readFileSync.onFirstCall().returns('{}'); - readFileSync.onSecondCall().returns('{}'); - readFileSync.onThirdCall().throws(); - findConfig = sandbox.stub().returns('/some/.mocharc.json'); - loadConfig = sandbox.stub().returns({}); - findupSync = sandbox.stub().returns('/some/package.json'); - - loadOptions = proxyLoadOptions({ - readFileSync, - findConfig, - loadConfig, - findupSync - }); - - result = loadOptions(); - }); - - it('should attempt to load default mocha.opts', function() { - expect(readFileSync, 'to have a call satisfying', [ - defaults.opts, - 'utf8' - ]); - }); - - it('should set opts = false', function() { - expect(result, 'to have property', 'opts', false); - }); - }); - }); - - describe('when path to mocha.opts (`--opts `) is valid', function() { - let result; - beforeEach(function() { - const filepath = '/path/to/mocha.opts'; - readFileSync = sandbox.stub(); - // package.json - readFileSync.onFirstCall().throws(); - // mocha.opts - readFileSync.onSecondCall().returns('--retries 3 foobar.spec.js'); - findConfig = sandbox.stub().returns('/some/.mocharc.json'); - loadConfig = sandbox.stub().returns({}); - findupSync = sandbox.stub().returns('/some/package.json'); - loadOptions = proxyLoadOptions({ - readFileSync, - findConfig, - loadConfig, - findupSync - }); - result = loadOptions(['--opts', filepath]); - }); - - it('should return merged options incl. mocha.opts', function() { - expect( - result, - 'to equal', - Object.assign( - { - _: ['foobar.spec.js'] - }, - defaults, - { - config: false, - opts: false, - package: false, - retries: '3' - } - ) - ); - }); - - it('should have attempted to load two files', function() { - expect(readFileSync, 'was called times', 2).and( - 'to have calls satisfying', - [ - {args: ['/some/package.json', 'utf8']}, - {args: ['/path/to/mocha.opts', 'utf8']} - ] - ); - }); - - it('should set opts = false', function() { - expect(result, 'to have property', 'opts', false); - }); - }); - - describe('when called with opts = false (`--no-opts`)', function() { - let result; - beforeEach(function() { - readFileSync = sandbox - .stub() - .returns('{"mocha": {"check-leaks": false}}'); - findConfig = sandbox.stub().returns('/some/.mocharc.json'); - loadConfig = sandbox.stub().returns({retries: 3}); - findupSync = sandbox.stub().returns('/some/package.json'); - - loadOptions = proxyLoadOptions({ - readFileSync, - findConfig, - loadConfig, - findupSync - }); - - result = loadOptions('--no-opts'); - }); - - it('should return parsed args, default config, config file, and package.json', function() { - expect( - result, - 'to equal', - Object.assign({_: []}, defaults, { - 'check-leaks': false, - config: false, - opts: false, - package: false, - retries: 3 - }) - ); - }); - - it('should not attempt to read any mocha.opts', function() { - expect(readFileSync, 'was called times', 1).and( - 'to have all calls satisfying', - ['/some/package.json', 'utf8'] - ); - }); - - it('should set opts = false', function() { - expect(result, 'to have property', 'opts', false); - }); - }); - }); - describe('package.json', function() { describe('when path to package.json (`--package `) is valid', function() { let result; @@ -278,8 +96,6 @@ describe('options', function() { readFileSync = sandbox.stub(); // package.json readFileSync.onFirstCall().returns('{"mocha": {"retries": 3}}'); - // mocha.opts - readFileSync.onSecondCall().throws(); findConfig = sandbox.stub().returns('/some/.mocharc.json'); loadConfig = sandbox.stub().returns({}); findupSync = sandbox.stub(); @@ -303,7 +119,6 @@ describe('options', function() { defaults, { config: false, - opts: false, package: false, retries: 3 } @@ -325,8 +140,6 @@ describe('options', function() { readFileSync = sandbox.stub(); // package.json readFileSync.onFirstCall().throws('yikes'); - // mocha.opts - readFileSync.onSecondCall().throws(); findConfig = sandbox.stub().returns('/some/.mocharc.json'); loadConfig = sandbox.stub().returns({}); findupSync = sandbox.stub(); @@ -359,8 +172,6 @@ describe('options', function() { readFileSync .onFirstCall() .returns('{"mocha": {"retries": 3, "_": ["foobar.spec.js"]}}'); - // mocha.opts - readFileSync.onSecondCall().throws(); findConfig = sandbox.stub().returns('/some/.mocharc.json'); loadConfig = sandbox.stub().returns({}); findupSync = sandbox.stub().returns(filepath); @@ -384,7 +195,6 @@ describe('options', function() { defaults, { config: false, - opts: false, package: false, retries: 3 } @@ -401,8 +211,7 @@ describe('options', function() { let result; beforeEach(function() { readFileSync = sandbox.stub(); - - readFileSync.onFirstCall().returns('--retries 3'); + readFileSync.onFirstCall().returns('{}'); findConfig = sandbox.stub().returns('/some/path/to/.mocharc.json'); loadConfig = sandbox.stub().returns({'check-leaks': true}); findupSync = sandbox.stub().returns('/some/package.json'); @@ -414,19 +223,18 @@ describe('options', function() { findupSync }); - result = loadOptions('--no-package'); + result = loadOptions('--no-diff --no-package'); }); - it('should return parsed args, default config, package.json and mocha.opts', function() { + it('should return parsed args and default config', function() { expect( result, 'to equal', Object.assign({_: []}, defaults, { + diff: false, 'check-leaks': true, config: false, - opts: false, - package: false, - retries: '3' + package: false }) ); }); @@ -451,7 +259,6 @@ describe('options', function() { .returns( '{"mocha": {"check-leaks": true, "_": ["foobar.spec.js"]}}' ); - readFileSync.onSecondCall().returns('--retries 3 foobar.spec.js'); findConfig = sandbox.stub(); loadConfig = sandbox.stub(); findupSync = sandbox.stub().returns('/some/package.json'); @@ -463,19 +270,18 @@ describe('options', function() { findupSync }); - result = loadOptions('--no-config'); + result = loadOptions('--no-diff --no-config'); }); - it('should return parsed args, default config, package.json and mocha.opts', function() { + it('should return parsed args, default config and package.json', function() { expect( result, 'to equal', Object.assign({_: ['foobar.spec.js']}, defaults, { + diff: false, 'check-leaks': true, config: false, - opts: false, - package: false, - retries: '3' + package: false }) ); }); @@ -500,7 +306,6 @@ describe('options', function() { readFileSync = sandbox.stub(); config = '/some/.mocharc.json'; readFileSync.onFirstCall().returns('{}'); - readFileSync.onSecondCall().returns('--retries 3'); findConfig = sandbox.stub(); loadConfig = sandbox.stub().throws('Error', 'failed to parse'); findupSync = sandbox.stub().returns('/some/package.json'); @@ -613,30 +418,13 @@ describe('options', function() { }); describe('config priority', function() { - it('should prioritize mocha.opts over defaults', function() { - readFileSync = sandbox.stub(); - readFileSync.onFirstCall().returns('{}'); - readFileSync.onSecondCall().returns('--timeout 800 --require foo'); - findConfig = sandbox.stub().returns('/some/.mocharc.json'); - loadConfig = sandbox.stub().returns({}); - findupSync = sandbox.stub().returns('/some/package.json'); - - loadOptions = proxyLoadOptions({ - readFileSync, - findConfig, - loadConfig, - findupSync - }); - - expect(loadOptions(), 'to satisfy', {timeout: '800', require: ['foo']}); - }); - - it('should prioritize package.json over mocha.opts', function() { + it('should prioritize package.json over defaults', function() { readFileSync = sandbox.stub(); readFileSync .onFirstCall() - .returns('{"mocha": {"timeout": 700, "require": "bar"}}'); - readFileSync.onSecondCall().returns('--timeout 800 --require foo'); + .returns( + '{"mocha": {"timeout": 700, "require": "bar", "extension": "ts"}}' + ); findConfig = sandbox.stub().returns('/some/.mocharc.json'); loadConfig = sandbox.stub().returns({}); findupSync = sandbox.stub().returns('/some/package.json'); @@ -650,7 +438,8 @@ describe('options', function() { expect(loadOptions(), 'to satisfy', { timeout: 700, - require: ['bar', 'foo'] + require: ['bar'], + extension: ['ts'] }); }); diff --git a/test/opts/mocha.opts b/test/opts/mocha.opts deleted file mode 100644 index c212a5b0d3..0000000000 --- a/test/opts/mocha.opts +++ /dev/null @@ -1,10 +0,0 @@ -### -### mocha.opts -### - ---require test/setup ---ui bdd ---globals okGlobalA,okGlobalB ---globals okGlobalC ---globals callback* ---timeout 300 diff --git a/test/opts/opts.spec.js b/test/opts/opts.spec.js deleted file mode 100644 index 74860421a8..0000000000 --- a/test/opts/opts.spec.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -// as of this writing we're using a config file instead of mocha.opts, -// so to run this test, we must use `--opts test/opts/mocha.opts` -// and `--no-config`. -describe('--opts', function() { - it('should use options present in test `mocha.opts`', function() { - // this will fail if config file was used and/or mocha.opts didn't load. - expect(this.timeout(), 'to be', 300); - }); -}); From dfaa65440789ec16fcbcdf6437ca0f5d20873686 Mon Sep 17 00:00:00 2001 From: Juerg B <44573692+juergba@users.noreply.github.com> Date: Wed, 18 Mar 2020 08:42:17 +0100 Subject: [PATCH 004/192] security: update mkdirp, yargs, yargs-parser (#4204) --- package-lock.json | 137 +++++++++++++++++++++------------------------- package.json | 6 +- 2 files changed, 64 insertions(+), 79 deletions(-) diff --git a/package-lock.json b/package-lock.json index cb8de65cb1..28f68e8da8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1359,7 +1359,7 @@ }, "source-map": { "version": "0.1.43", - "resolved": "http://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", "dev": true, "optional": true, @@ -1371,7 +1371,7 @@ }, "ast-types": { "version": "0.7.8", - "resolved": "http://registry.npmjs.org/ast-types/-/ast-types-0.7.8.tgz", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.7.8.tgz", "integrity": "sha1-kC0uDWDQcb3NRtwRXhgJ7RHBOKk=", "dev": true }, @@ -1973,7 +1973,7 @@ "bn.js": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha1-LN4J617jQfSEdGuwMJsyU7GxRC8=", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", "dev": true }, "body-parser": { @@ -2138,7 +2138,7 @@ }, "brfs": { "version": "1.6.1", - "resolved": "http://registry.npmjs.org/brfs/-/brfs-1.6.1.tgz", + "resolved": "https://registry.npmjs.org/brfs/-/brfs-1.6.1.tgz", "integrity": "sha512-OfZpABRQQf+Xsmju8XE9bDjs+uU4vLREGolP7bDgcpsI17QREyZ4Bl+2KLxxx1kCgA0fAIhKQBaBYh+PEcCqYQ==", "dev": true, "requires": { @@ -2397,7 +2397,7 @@ }, "yargs": { "version": "6.4.0", - "resolved": "http://registry.npmjs.org/yargs/-/yargs-6.4.0.tgz", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-6.4.0.tgz", "integrity": "sha1-gW4ahm1VmMzzTlWW3c4i2S2kkNQ=", "dev": true, "requires": { @@ -2419,7 +2419,7 @@ }, "yargs-parser": { "version": "4.2.1", - "resolved": "http://registry.npmjs.org/yargs-parser/-/yargs-parser-4.2.1.tgz", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-4.2.1.tgz", "integrity": "sha1-KczqwNxPA8bIe0qfIX3RjJ90hxw=", "dev": true, "requires": { @@ -3184,7 +3184,7 @@ "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha1-h2Dk7MJy9MNjUy+SbYdKriwTl94=", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", "dev": true, "requires": { "inherits": "^2.0.1", @@ -3327,7 +3327,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, "requires": { "string-width": "^3.1.0", "strip-ansi": "^5.2.0", @@ -3338,7 +3337,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, "requires": { "emoji-regex": "^7.0.1", "is-fullwidth-code-point": "^2.0.0", @@ -3349,7 +3347,6 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, "requires": { "ansi-styles": "^3.2.0", "string-width": "^3.0.0", @@ -3898,7 +3895,7 @@ "createerror": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/createerror/-/createerror-1.3.0.tgz", - "integrity": "sha1-xma9TNa5TjVBU5ZWnUZJ3QzbMxM=", + "integrity": "sha512-w9UZUtkaGd8MfS7eMG7Sa0lV5vCJghqQfiOnwNVrPhbZScUp5h0jwYoAF933MKlotlG1JAJOCCT3xU6r+SDKNw==", "dev": true }, "cross-env": { @@ -5483,7 +5480,7 @@ "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" @@ -5886,7 +5883,7 @@ "evp_bytestokey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha1-f8vbGY3HGVlDLv4ThCaE4FJaywI=", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "dev": true, "requires": { "md5.js": "^1.3.4", @@ -6530,13 +6527,13 @@ "dependencies": { "colors": { "version": "0.6.2", - "resolved": "http://registry.npmjs.org/colors/-/colors-0.6.2.tgz", + "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", "integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=", "dev": true }, "commander": { "version": "2.1.0", - "resolved": "http://registry.npmjs.org/commander/-/commander-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.1.0.tgz", "integrity": "sha1-0SG7roYNmZKj1Re6lvVliOR8Z4E=", "dev": true } @@ -7431,7 +7428,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { @@ -7651,7 +7648,7 @@ }, "got": { "version": "6.7.1", - "resolved": "http://registry.npmjs.org/got/-/got-6.7.1.tgz", + "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", "dev": true, "requires": { @@ -7992,7 +7989,7 @@ "html-encoding-sniffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", - "integrity": "sha1-5w2EuU2lOqN14R/jo1G+ZkLKRvg=", + "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", "dev": true, "requires": { "whatwg-encoding": "^1.0.1" @@ -9220,7 +9217,7 @@ "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha1-LBY7P6+xtgbZ0Xko8FwqHDjgdnc=", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "requires": { "isobject": "^3.0.1" @@ -10445,7 +10442,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { @@ -10607,7 +10604,7 @@ }, "yargs": { "version": "6.6.0", - "resolved": "http://registry.npmjs.org/yargs/-/yargs-6.6.0.tgz", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-6.6.0.tgz", "integrity": "sha1-eC7CHvQDNF+DCoCMo9UTr1YGUgg=", "dev": true, "requires": { @@ -10628,7 +10625,7 @@ }, "yargs-parser": { "version": "4.2.1", - "resolved": "http://registry.npmjs.org/yargs-parser/-/yargs-parser-4.2.1.tgz", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-4.2.1.tgz", "integrity": "sha1-KczqwNxPA8bIe0qfIX3RjJ90hxw=", "dev": true, "requires": { @@ -10911,7 +10908,7 @@ }, "magic-string": { "version": "0.22.5", - "resolved": "http://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", "integrity": "sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w==", "dev": true, "requires": { @@ -11077,7 +11074,7 @@ }, "globby": { "version": "6.1.0", - "resolved": "http://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", "dev": true, "requires": { @@ -11160,7 +11157,7 @@ "markdown-toc": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/markdown-toc/-/markdown-toc-1.2.0.tgz", - "integrity": "sha1-RKFWBoREkDFK/ARESD+eexEiwzk=", + "integrity": "sha512-eOsq7EGd3asV0oBfmyqngeEIhrbkc7XVP63OwcJBIhH2EpG2PzFcbZdhy1jutXSlRBBVMNXHvMtSr5LAxSUvUg==", "dev": true, "requires": { "concat-stream": "^1.5.2", @@ -11470,7 +11467,7 @@ "miller-rabin": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha1-8IA1HIZbDcViqEYpZtqlNUPHik0=", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", "dev": true, "requires": { "bn.js": "^4.0.0", @@ -11532,8 +11529,9 @@ }, "minimist": { "version": "0.0.8", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true }, "minipass": { "version": "2.9.0", @@ -11590,11 +11588,18 @@ } }, "mkdirp": { - "version": "0.5.1", - "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz", + "integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==", "requires": { - "minimist": "0.0.8" + "minimist": "^1.2.5" + }, + "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + } } }, "module-definition": { @@ -11790,7 +11795,7 @@ "no-case": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", - "integrity": "sha1-YLgTOWvjmz8SiKTB7V0efSi0ZKw=", + "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==", "dev": true, "requires": { "lower-case": "^1.1.1" @@ -11892,7 +11897,7 @@ }, "tty-browserify": { "version": "0.0.0", - "resolved": "http://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", "dev": true }, @@ -12491,7 +12496,7 @@ }, "resolve-from": { "version": "4.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, @@ -12653,7 +12658,7 @@ }, "opn": { "version": "5.3.0", - "resolved": "http://registry.npmjs.org/opn/-/opn-5.3.0.tgz", + "resolved": "https://registry.npmjs.org/opn/-/opn-5.3.0.tgz", "integrity": "sha512-bYJHo/LOmoTd+pfiYhfZDnf9zekVJrY+cnS2a5F2x+w5ppvTqObojTP7WiFG+kVZs9Inw+qQ/lw7TroWwhdd2g==", "dev": true, "requires": { @@ -13025,7 +13030,7 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-is-inside": { @@ -13195,7 +13200,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", + "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", "dev": true, "requires": { "chalk": "^1.1.3", @@ -13797,7 +13802,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", + "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", "dev": true, "requires": { "chalk": "^1.1.3", @@ -14001,13 +14006,13 @@ }, "pretty-bytes": { "version": "4.0.2", - "resolved": "http://registry.npmjs.org/pretty-bytes/-/pretty-bytes-4.0.2.tgz", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-4.0.2.tgz", "integrity": "sha1-sr+C5zUNZcbDOqlaqlpPYyf2HNk=", "dev": true }, "pretty-ms": { "version": "0.2.2", - "resolved": "http://registry.npmjs.org/pretty-ms/-/pretty-ms-0.2.2.tgz", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-0.2.2.tgz", "integrity": "sha1-2oeaaC/zOjcBEEbxPWJ/Z8c7hPY=", "dev": true, "requires": { @@ -14209,7 +14214,7 @@ }, "yargs": { "version": "3.10.0", - "resolved": "http://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", "dev": true, "requires": { @@ -15008,7 +15013,7 @@ }, "rgba-regex": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/rgba-regex/-/rgba-regex-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/rgba-regex/-/rgba-regex-1.0.0.tgz", "integrity": "sha1-QzdOLiyglosO8VI0YLfXMP8i7rM=", "dev": true }, @@ -15136,7 +15141,7 @@ "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha1-KBYjTiN4vdxOU1T6tcqold9xANk=", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true }, "saxes": { @@ -16566,7 +16571,7 @@ }, "strip-eof": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, @@ -17242,7 +17247,7 @@ }, "strip-ansi": { "version": "0.1.1", - "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz", "integrity": "sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE=", "dev": true } @@ -17285,7 +17290,7 @@ "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha1-bTQzWIl2jSGyvNoKonfO07G/rfk=", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, "requires": { "os-tmpdir": "~1.0.2" @@ -18261,7 +18266,7 @@ "webidl-conversions": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha1-qFWYCx8LazWbodXZ+zmulB+qY60=", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", "dev": true }, "whatwg-encoding": { @@ -18390,7 +18395,7 @@ }, "wrap-ansi": { "version": "2.1.0", - "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "dev": true, "requires": { @@ -18551,9 +18556,9 @@ "dev": true }, "yargs": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", - "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", "requires": { "cliui": "^5.0.0", "find-up": "^3.0.0", @@ -18564,19 +18569,9 @@ "string-width": "^3.0.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^13.1.1" + "yargs-parser": "^13.1.2" }, "dependencies": { - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -18596,23 +18591,13 @@ "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^5.1.0" } - }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - } } } }, "yargs-parser": { - "version": "13.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", - "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" diff --git a/package.json b/package.json index a3de8e44af..00f72a330f 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "js-yaml": "3.13.1", "log-symbols": "3.0.0", "minimatch": "3.0.4", - "mkdirp": "0.5.1", + "mkdirp": "0.5.3", "ms": "2.1.1", "node-environment-flags": "1.0.6", "object.assign": "4.1.0", @@ -64,8 +64,8 @@ "supports-color": "6.0.0", "which": "1.3.1", "wide-align": "1.1.3", - "yargs": "13.3.0", - "yargs-parser": "13.1.1", + "yargs": "13.3.2", + "yargs-parser": "13.1.2", "yargs-unparser": "1.6.0" }, "devDependencies": { From c1a8adb1caa5093b05020762a7ab8e1a119a6990 Mon Sep 17 00:00:00 2001 From: Juerg B <44573692+juergba@users.noreply.github.com> Date: Wed, 18 Mar 2020 11:11:04 +0100 Subject: [PATCH 005/192] update CHANGELOG for v7.1.1 [ci skip] --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cf0b4e8cc..8c2f86a222 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +# 7.1.1 / 2020-03-18 + +## :lock: Security Fixes + +- [#4204](https://github.com/mochajs/mocha/issues/4204): Update dependencies mkdirp, yargs-parser and yargs ([**@juergba**](https://github.com/juergba)) + +## :bug: Fixes + +- [#3660](https://github.com/mochajs/mocha/issues/3660): Fix `runner` listening to `start` and `end` events ([**@juergba**](https://github.com/juergba)) + +## :book: Documentation + +- [#4190](https://github.com/mochajs/mocha/issues/4190): Show Netlify badge on footer ([**@outsideris**](https://github.com/outsideris)) + # 7.1.0 / 2020-02-26 ## :tada: Enhancements From f87825a2e7ed2af79c0393cfd76bd73edebcc1d9 Mon Sep 17 00:00:00 2001 From: HYUNSANG HAN Date: Thu, 19 Mar 2020 18:38:47 +0900 Subject: [PATCH 006/192] Drop mkdirp and replace it with fs.mkdirSync (#4200) - Replace mkdirp with fs.mkdirSync using {recursive: true} - Drop the dependency mkdirp from Mocha - Fix version number of docs and package.json --- .github/CONTRIBUTING.md | 2 +- docs/README.md | 2 +- docs/index.md | 2 +- karma.conf.js | 3 +-- lib/cli/init.js | 3 +-- lib/reporters/xunit.js | 5 +++-- package-lock.json | 10 +++++----- package.json | 3 +-- test/integration/file-utils.spec.js | 3 +-- test/reporters/xunit.spec.js | 13 +++++++++---- 10 files changed, 24 insertions(+), 22 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 4614aa046e..2d7b5e5f85 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -42,7 +42,7 @@ Follow these steps to get going. If you are having trouble, don't be afraid to [ > PRO TIP: After `npm install`, run `npm start` to see a list of commands which can be run with `npm start ` (powered by [nps](https://npm.im/nps)). -1. [Install Node.js 10.x or newer](https://nodejs.org/en/download/). +1. [Install Node.js 10.12.0 or newer](https://nodejs.org/en/download/). - If you're new to installing Node, a tool like [nvm](https://github.com/creationix/nvm#install-script) can help you manage multiple version installations. - You will need [Google Chrome](https://www.google.com/chrome/) to run browser-based tests locally. 1. Follow [Github's documentation](https://help.github.com/articles/fork-a-repo/) on setting up Git, forking and cloning. diff --git a/docs/README.md b/docs/README.md index 0aeef4d5ca..ab083fe29d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -6,7 +6,7 @@ _So you wanna build the site?_ ## Prerequisites -- Node.js v10.x or greater +- Node.js v10.12.0 or greater ## Development diff --git a/docs/index.md b/docs/index.md index 898d8f1de5..aeaa1c318c 100644 --- a/docs/index.md +++ b/docs/index.md @@ -97,7 +97,7 @@ or as a development dependency for your project: $ npm install --save-dev mocha ``` -> As of v8.0.0, Mocha requires Node.js v10.0.0 or newer. +> As of v8.0.0, Mocha requires Node.js v10.12.0 or newer. ## Getting Started diff --git a/karma.conf.js b/karma.conf.js index ae84d7d830..9337e3d3b8 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -2,7 +2,6 @@ const fs = require('fs'); const path = require('path'); -const mkdirp = require('mkdirp'); const os = require('os'); const baseBundleDirpath = path.join(__dirname, '.karma'); @@ -111,7 +110,7 @@ module.exports = config => { console.error('No SauceLabs credentials present'); } } - mkdirp.sync(bundleDirpath); + fs.mkdirSync(bundleDirpath, {recursive: true}); } else { console.error('CI mode disabled'); } diff --git a/lib/cli/init.js b/lib/cli/init.js index ca847c6f1e..3847aff86c 100644 --- a/lib/cli/init.js +++ b/lib/cli/init.js @@ -9,7 +9,6 @@ const fs = require('fs'); const path = require('path'); -const mkdirp = require('mkdirp'); exports.command = 'init '; @@ -24,7 +23,7 @@ exports.builder = yargs => exports.handler = argv => { const destdir = argv.path; const srcdir = path.join(__dirname, '..', '..'); - mkdirp.sync(destdir); + fs.mkdirSync(destdir, {recursive: true}); const css = fs.readFileSync(path.join(srcdir, 'mocha.css')); const js = fs.readFileSync(path.join(srcdir, 'mocha.js')); const tmpl = fs.readFileSync( diff --git a/lib/reporters/xunit.js b/lib/reporters/xunit.js index da366cdaa1..a690ac5343 100644 --- a/lib/reporters/xunit.js +++ b/lib/reporters/xunit.js @@ -9,7 +9,6 @@ var Base = require('./base'); var utils = require('../utils'); var fs = require('fs'); -var mkdirp = require('mkdirp'); var path = require('path'); var errors = require('../errors'); var createUnsupportedError = errors.createUnsupportedError; @@ -62,7 +61,9 @@ function XUnit(runner, options) { throw createUnsupportedError('file output not supported in browser'); } - mkdirp.sync(path.dirname(options.reporterOptions.output)); + fs.mkdirSync(path.dirname(options.reporterOptions.output), { + recursive: true + }); self.fileStream = fs.createWriteStream(options.reporterOptions.output); } diff --git a/package-lock.json b/package-lock.json index 28f68e8da8..b2533ca949 100644 --- a/package-lock.json +++ b/package-lock.json @@ -702,7 +702,7 @@ "aproba": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "integrity": "sha1-aALmJk79GMeQobDVF/DyYnvyyUo=", "dev": true }, "arch": { @@ -2227,7 +2227,7 @@ "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==" + "integrity": "sha1-uqVZ7hTO1zRSIputcyZGfGH6vWA=" }, "browser-sync": { "version": "2.26.7", @@ -4739,7 +4739,7 @@ "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==" + "integrity": "sha1-gAwN0eCov7yVg1wgKtIg/jF+WhI=" }, "diffie-hellman": { "version": "5.0.3", @@ -7359,7 +7359,7 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=" }, "functional-red-black-tree": { "version": "1.0.1", @@ -12084,7 +12084,7 @@ "npmlog": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "integrity": "sha1-CKfyqL9zRgR3mp76StXMcXq7lUs=", "dev": true, "requires": { "are-we-there-yet": "~1.1.2", diff --git a/package.json b/package.json index 00f72a330f..1863e87622 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "test": "./test" }, "engines": { - "node": ">= 10.0.0" + "node": ">= 10.12.0" }, "scripts": { "prepublishOnly": "nps test clean build", @@ -56,7 +56,6 @@ "js-yaml": "3.13.1", "log-symbols": "3.0.0", "minimatch": "3.0.4", - "mkdirp": "0.5.3", "ms": "2.1.1", "node-environment-flags": "1.0.6", "object.assign": "4.1.0", diff --git a/test/integration/file-utils.spec.js b/test/integration/file-utils.spec.js index 0b5b2e92fe..8c48e4a826 100644 --- a/test/integration/file-utils.spec.js +++ b/test/integration/file-utils.spec.js @@ -4,7 +4,6 @@ var utils = require('../../lib/utils'); var fs = require('fs'); var path = require('path'); var os = require('os'); -var mkdirp = require('mkdirp'); var rimraf = require('rimraf'); describe('file utils', function() { @@ -119,7 +118,7 @@ describe('file utils', function() { afterEach(removeTempDir); function makeTempDir() { - mkdirp.sync(tmpDir); + fs.mkdirSync(tmpDir, {recursive: true}); } function removeTempDir() { diff --git a/test/reporters/xunit.spec.js b/test/reporters/xunit.spec.js index 736f9d1112..323db703a9 100644 --- a/test/reporters/xunit.spec.js +++ b/test/reporters/xunit.spec.js @@ -4,7 +4,6 @@ var EventEmitter = require('events').EventEmitter; var fs = require('fs'); var os = require('os'); var path = require('path'); -var mkdirp = require('mkdirp'); var rimraf = require('rimraf'); var sinon = require('sinon'); var createStatsCollector = require('../../lib/stats-collector'); @@ -51,12 +50,12 @@ describe('XUnit reporter', function() { }; describe('when fileStream can be created', function() { - var mkdirpSync; + var fsMkdirSync; var fsCreateWriteStream; beforeEach(function() { sandbox = sinon.createSandbox(); - mkdirpSync = sandbox.stub(mkdirp, 'sync'); + fsMkdirSync = sandbox.stub(fs, 'mkdirSync'); fsCreateWriteStream = sandbox.stub(fs, 'createWriteStream'); }); @@ -67,7 +66,13 @@ describe('XUnit reporter', function() { XUnit.call(fakeThis, runner, options); var expectedDirectory = path.dirname(expectedOutput); - expect(mkdirpSync.calledWith(expectedDirectory), 'to be true'); + expect( + fsMkdirSync.calledWith(expectedDirectory, { + recursive: true + }), + 'to be true' + ); + expect(fsCreateWriteStream.calledWith(expectedOutput), 'to be true'); }); From 6320d3df4df7368d784f4b6b511e06d036370dfe Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Wed, 18 Mar 2020 12:42:01 -0700 Subject: [PATCH 007/192] add wallaby logo to bottom of site --- docs/_includes/default.html | 16 +++++++++++++++- docs/css/style.css | 18 ++++++++++++++++++ docs/images/wallaby-logo.png | Bin 0 -> 578 bytes 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 docs/images/wallaby-logo.png diff --git a/docs/_includes/default.html b/docs/_includes/default.html index 7e3a29f000..cdef5c2276 100644 --- a/docs/_includes/default.html +++ b/docs/_includes/default.html @@ -31,7 +31,11 @@

{{ content }}