From 54a57880e41d750509320c4dad19deccd0b6afd2 Mon Sep 17 00:00:00 2001 From: Juerg B <44573692+juergba@users.noreply.github.com> Date: Sat, 31 Jul 2021 14:40:10 +0200 Subject: [PATCH 01/10] Add new option "node-option" (#4691) --- bin/mocha | 45 +++++++++------------ docs/index.md | 19 ++++++--- example/config/.mocharc.js | 1 + example/config/.mocharc.yml | 2 + lib/cli/cli.js | 5 ++- lib/cli/node-flags.js | 7 +--- lib/cli/run-option-metadata.js | 2 + lib/cli/run.js | 4 ++ test/integration/options/node-flags.spec.js | 16 ++++++++ test/integration/options/timeout.spec.js | 17 +++++++- test/node-unit/cli/node-flags.spec.js | 8 +--- 11 files changed, 79 insertions(+), 47 deletions(-) diff --git a/bin/mocha b/bin/mocha index 79d35562d4..fb58e65fcd 100755 --- a/bin/mocha +++ b/bin/mocha @@ -10,7 +10,6 @@ * @private */ -const {deprecate} = require('../lib/utils'); const {loadOptions} = require('../lib/cli/options'); const { unparseNodeFlags, @@ -23,6 +22,7 @@ const {aliases} = require('../lib/cli/run-option-metadata'); const mochaArgs = {}; const nodeArgs = {}; +let hasInspect = false; const opts = loadOptions(process.argv.slice(2)); debug('loaded opts', opts); @@ -59,48 +59,39 @@ Object.keys(opts).forEach(opt => { // disable 'timeout' for debugFlags Object.keys(nodeArgs).forEach(opt => disableTimeouts(opt)); +mochaArgs['node-option'] && + mochaArgs['node-option'].forEach(opt => disableTimeouts(opt)); // Native debugger handling // see https://nodejs.org/api/debugger.html#debugger_debugger -// look for 'inspect' or 'debug' that would launch this debugger, +// look for 'inspect' that would launch this debugger, // remove it from Mocha's opts and prepend it to Node's opts. // A deprecation warning will be printed by node, if applicable. // (mochaArgs._ are "positional" arguments, not prefixed with - or --) if (mochaArgs._) { - const i = mochaArgs._.findIndex(val => val === 'inspect' || val === 'debug'); + const i = mochaArgs._.findIndex(val => val === 'inspect'); if (i > -1) { - const [command] = mochaArgs._.splice(i, 1); + mochaArgs._.splice(i, 1); disableTimeouts('inspect'); - nodeArgs._ = [command]; + hasInspect = true; } } -// historical -if (nodeArgs.gc) { - deprecate( - '"-gc" is deprecated and will be removed from a future version of Mocha. Use "--gc-global" instead.' - ); - nodeArgs['gc-global'] = nodeArgs.gc; - delete nodeArgs.gc; -} - -// --require/-r is treated as Mocha flag except when 'esm' is preloaded -if (mochaArgs.require && mochaArgs.require.includes('esm')) { - nodeArgs.require = ['esm']; - mochaArgs.require = mochaArgs.require.filter(mod => mod !== 'esm'); - if (!mochaArgs.require.length) { - delete mochaArgs.require; - } -} - -if (Object.keys(nodeArgs).length) { +if (mochaArgs['node-option'] || Object.keys(nodeArgs).length || hasInspect) { const {spawn} = require('child_process'); const mochaPath = require.resolve('../lib/cli/cli.js'); - debug('final node args', nodeArgs); + const nodeArgv = + (mochaArgs['node-option'] && mochaArgs['node-option'].map(v => '--' + v)) || + unparseNodeFlags(nodeArgs); + + if (hasInspect) nodeArgv.unshift('inspect'); + delete mochaArgs['node-option']; + + debug('final node argv', nodeArgv); const args = [].concat( - unparseNodeFlags(nodeArgs), + nodeArgv, mochaPath, unparse(mochaArgs, {alias: aliases}) ); @@ -147,5 +138,5 @@ if (Object.keys(nodeArgs).length) { }); } else { debug('running Mocha in-process'); - require('../lib/cli/cli').main(unparse(mochaArgs, {alias: aliases})); + require('../lib/cli/cli').main([], mochaArgs); } diff --git a/docs/index.md b/docs/index.md index 12b4b18955..86497d0ab1 100644 --- a/docs/index.md +++ b/docs/index.md @@ -876,9 +876,7 @@ Use this option to have Mocha check for global variables that are leaked while r ### `--dry-run` -> _New in v9.0.0._ - -Report tests without executing any of them, neither tests nor hooks. +> _New in v9.0.0._ Report tests without executing any of them, neither tests nor hooks. ### `--exit` @@ -1015,6 +1013,15 @@ Specify an explicit path to a [configuration file](#configuring-mocha-nodejs). By default, Mocha will search for a config file if `--config` is not specified; use `--no-config` to suppress this behavior. +### `--node-option , -n ` + +> _New in v9.1.0._ + +For Node.js and V8 options. Mocha forwards these options to Node.js by spawning a new child-process.
+The options are set without leading dashes `--`, e.g. `-n require=foo -n unhandled-rejections=strict` + +Can also be specified as a comma-delimited list: `-n require=foo,unhandled-rejections=strict` + ### `--opts ` > _Removed in v8.0.0. Please use [configuration file](#configuring-mocha-nodejs) instead._ @@ -1159,8 +1166,6 @@ Requires either `--grep` or `--fgrep` (but not both). ### `--inspect, --inspect-brk, inspect` -> _BREAKING CHANGE in v7.0.0; `--debug` / `--debug-brk` are removed and `debug` is deprecated._ - Enables Node.js' inspector. Use `--inspect` / `--inspect-brk` to launch the V8 inspector for use with Chrome Dev Tools. @@ -1209,6 +1214,8 @@ These flags vary depending on your version of Node.js. `node` flags can be defined in Mocha's [configuration](#configuring-mocha-nodejs). +> _New in v9.1.0._ You can also pass `node` flags to Node.js using [`--node-option`](#-node-option-name-n-name). + ### `--enable-source-maps` > _New in Node.js v12.12.0_ @@ -1228,6 +1235,8 @@ Prepend `--v8-` to any flag listed in the output of `node --v8-options` (excludi V8 flags can be defined in Mocha's [configuration](#configuring-mocha-nodejs). +> _New in v9.1.0._ You can also pass V8 flags (without `--v8-`) to Node.js using [`--node-option`](#-node-option-name-n-name). + ## Parallel Tests > _New in v.8.0.0._ diff --git a/example/config/.mocharc.js b/example/config/.mocharc.js index 235f6e0b86..bdd89e769f 100644 --- a/example/config/.mocharc.js +++ b/example/config/.mocharc.js @@ -26,6 +26,7 @@ module.exports = { 'inline-diffs': false, // invert: false, // needs to be used with grep or fgrep jobs: 1, + 'node-option': ['unhandled-rejections=strict'], // without leading "--", also V8 flags package: './package.json', parallel: false, recursive: false, diff --git a/example/config/.mocharc.yml b/example/config/.mocharc.yml index 0172f7cd40..4ba30dff22 100644 --- a/example/config/.mocharc.yml +++ b/example/config/.mocharc.yml @@ -29,6 +29,8 @@ inline-diffs: false # needs to be used with grep or fgrep # invert: false jobs: 1 +node-option: + - 'unhandled-rejections=strict' # without leading "--", also V8 flags package: './package.json' parallel: false recursive: false diff --git a/lib/cli/cli.js b/lib/cli/cli.js index f3b780cf9d..977a341564 100755 --- a/lib/cli/cli.js +++ b/lib/cli/cli.js @@ -33,8 +33,9 @@ const {cwd} = require('../utils'); * @public * @summary Mocha's main command-line entry-point. * @param {string[]} argv - Array of arguments to parse, or by default the lovely `process.argv.slice(2)` + * @param {object} [mochaArgs] - Object of already parsed Mocha arguments (by bin/mocha) */ -exports.main = (argv = process.argv.slice(2)) => { +exports.main = (argv = process.argv.slice(2), mochaArgs) => { debug('entered main with raw args', argv); // ensure we can require() from current working directory if (typeof module.paths !== 'undefined') { @@ -43,7 +44,7 @@ exports.main = (argv = process.argv.slice(2)) => { Error.stackTraceLimit = Infinity; // configurable via --stack-trace-limit? - var args = loadOptions(argv); + var args = mochaArgs || loadOptions(argv); yargs() .scriptName('mocha') diff --git a/lib/cli/node-flags.js b/lib/cli/node-flags.js index 1203ad2ea8..25ca2669c5 100644 --- a/lib/cli/node-flags.js +++ b/lib/cli/node-flags.js @@ -49,7 +49,7 @@ exports.isNodeFlag = (flag, bareword = true) => { // and also any V8 flags with `--v8-` prefix (!isMochaFlag(flag) && nodeFlags && nodeFlags.has(flag)) || debugFlags.has(flag) || - /(?:preserve-symlinks(?:-main)?|harmony(?:[_-]|$)|(?:trace[_-].+$)|gc(?:[_-]global)?$|es[_-]staging$|use[_-]strict$|v8[_-](?!options).+?$)/.test( + /(?:preserve-symlinks(?:-main)?|harmony(?:[_-]|$)|(?:trace[_-].+$)|gc[_-]global$|es[_-]staging$|use[_-]strict$|v8[_-](?!options).+?$)/.test( flag ) ); @@ -67,7 +67,6 @@ exports.impliesNoTimeouts = flag => debugFlags.has(flag); /** * All non-strictly-boolean arguments to node--those with values--must specify those values using `=`, e.g., `--inspect=0.0.0.0`. * Unparse these arguments using `yargs-unparser` (which would result in `--inspect 0.0.0.0`), then supply `=` where we have values. - * Apparently --require in Node.js v8 does NOT want `=`. * There's probably an easier or more robust way to do this; fixes welcome * @param {Object} opts - Arguments object * @returns {string[]} Unparsed arguments using `=` to specify values @@ -79,9 +78,7 @@ exports.unparseNodeFlags = opts => { ? args .join(' ') .split(/\b/) - .map((arg, index, args) => - arg === ' ' && args[index - 1] !== 'require' ? '=' : arg - ) + .map(arg => (arg === ' ' ? '=' : arg)) .join('') .split(' ') : []; diff --git a/lib/cli/run-option-metadata.js b/lib/cli/run-option-metadata.js index fc870992c9..6bc6604018 100644 --- a/lib/cli/run-option-metadata.js +++ b/lib/cli/run-option-metadata.js @@ -18,6 +18,7 @@ const TYPES = (exports.types = { 'file', 'global', 'ignore', + 'node-option', 'reporter-option', 'require', 'spec', @@ -79,6 +80,7 @@ exports.aliases = { invert: ['i'], jobs: ['j'], 'no-colors': ['C'], + 'node-option': ['n'], parallel: ['p'], reporter: ['R'], 'reporter-option': ['reporter-options', 'O'], diff --git a/lib/cli/run.js b/lib/cli/run.js index 79903327c3..06941fab8c 100644 --- a/lib/cli/run.js +++ b/lib/cli/run.js @@ -176,6 +176,10 @@ exports.builder = yargs => group: GROUPS.OUTPUT, hidden: true }, + 'node-option': { + description: 'Node or V8 option (no leading "--")', + group: GROUPS.CONFIG + }, package: { description: 'Path to package.json for config', group: GROUPS.CONFIG, diff --git a/test/integration/options/node-flags.spec.js b/test/integration/options/node-flags.spec.js index b884482527..b1a87ac296 100644 --- a/test/integration/options/node-flags.spec.js +++ b/test/integration/options/node-flags.spec.js @@ -17,3 +17,19 @@ describe('node flags', function() { ); }); }); + +describe('node flags using "--node-option"', function() { + it('should pass fake option to node and fail with node exception', function(done) { + invokeMocha( + ['--node-option', 'fake-flag'], + function(err, res) { + if (err) { + return done(err); + } + expect(res, 'to have failed with output', /bad option: --fake-flag/i); + done(); + }, + 'pipe' + ); + }); +}); diff --git a/test/integration/options/timeout.spec.js b/test/integration/options/timeout.spec.js index 4470c8b310..e2524c12f8 100644 --- a/test/integration/options/timeout.spec.js +++ b/test/integration/options/timeout.spec.js @@ -50,7 +50,7 @@ describe('--timeout', function() { }); }); - it('should disable timeout with --inspect', function(done) { + it('should disable timeout with "--inspect"', function(done) { var fixture = 'options/slow-test'; runMochaJSON(fixture, ['--inspect', '--timeout', '200'], function( err, @@ -64,4 +64,19 @@ describe('--timeout', function() { done(); }); }); + + it('should disable timeout with "-n inspect"', function(done) { + var fixture = 'options/slow-test'; + runMochaJSON(fixture, ['-n', 'inspect', '--timeout', '200'], function( + err, + res + ) { + if (err) { + done(err); + return; + } + expect(res, 'to have passed').and('to have passed test count', 2); + done(); + }); + }); }); diff --git a/test/node-unit/cli/node-flags.spec.js b/test/node-unit/cli/node-flags.spec.js index 838d659fab..627a90378f 100644 --- a/test/node-unit/cli/node-flags.spec.js +++ b/test/node-unit/cli/node-flags.spec.js @@ -42,12 +42,7 @@ describe('node-flags', function() { it('should return true for flags starting with "preserve-symlinks"', function() { expect(isNodeFlag('preserve-symlinks'), 'to be true'); expect(isNodeFlag('preserve-symlinks-main'), 'to be true'); - // Node >= v12 both flags exist in process.allowedNodeEnvironmentFlags - const nodeVersion = parseInt(process.version.match(/^v(\d+)\./)[1], 10); - expect( - isNodeFlag('preserve_symlinks'), - nodeVersion >= 12 ? 'to be true' : 'to be false' - ); + expect(isNodeFlag('preserve_symlinks'), 'to be true'); }); it('should return true for flags starting with "harmony-" or "harmony_"', function() { @@ -69,7 +64,6 @@ describe('node-flags', function() { it('should return true for "gc-global"', function() { expect(isNodeFlag('gc-global'), 'to be true'); expect(isNodeFlag('gc_global'), 'to be true'); - expect(isNodeFlag('gc'), 'to be true'); }); it('should return true for "es-staging"', function() { From 02bf13d51c4c2a8b6167e1701067c58d169ca92b Mon Sep 17 00:00:00 2001 From: Juerg B <44573692+juergba@users.noreply.github.com> Date: Mon, 2 Aug 2021 15:11:24 +0200 Subject: [PATCH 02/10] Update devDep '@babel/preset-env' and pin 'regenerator-runtime' (#4707) --- package-lock.json | 765 +++++++++++++++++++++++++++------------------- package.json | 7 +- 2 files changed, 450 insertions(+), 322 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1c0a9fe4c1..cc8c1a437d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -138,20 +138,20 @@ "dev": true }, "@babel/core": { - "version": "7.14.6", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.14.6.tgz", - "integrity": "sha512-gJnOEWSqTk96qG5BoIrl5bVtc23DCycmIePPYnamY9RboYdI4nFy5vAQMSl81O5K/W0sLDWfGysnOECC+KUUCA==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.14.8.tgz", + "integrity": "sha512-/AtaeEhT6ErpDhInbXmjHcUQXH0L0TEgscfcxk1qbOvLuKCa5aZT0SOOtDKFY96/CLROwbLSKyFor6idgNaU4Q==", "dev": true, "requires": { "@babel/code-frame": "^7.14.5", - "@babel/generator": "^7.14.5", + "@babel/generator": "^7.14.8", "@babel/helper-compilation-targets": "^7.14.5", - "@babel/helper-module-transforms": "^7.14.5", - "@babel/helpers": "^7.14.6", - "@babel/parser": "^7.14.6", + "@babel/helper-module-transforms": "^7.14.8", + "@babel/helpers": "^7.14.8", + "@babel/parser": "^7.14.8", "@babel/template": "^7.14.5", - "@babel/traverse": "^7.14.5", - "@babel/types": "^7.14.5", + "@babel/traverse": "^7.14.8", + "@babel/types": "^7.14.8", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -160,15 +160,6 @@ "source-map": "^0.5.0" }, "dependencies": { - "json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -184,12 +175,12 @@ } }, "@babel/generator": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.5.tgz", - "integrity": "sha512-y3rlP+/G25OIX3mYKKIOlQRcqj7YgrvHxOLbVmyLJ9bPmi5ttvUmpydVjcFjZphOktWuA7ovbx91ECloWTfjIA==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.8.tgz", + "integrity": "sha512-cYDUpvIzhBVnMzRoY1fkSEhK/HmwEVwlyULYgn/tMQYd6Obag3ylCjONle3gdErfXBW61SVTlR9QR7uWlgeIkg==", "dev": true, "requires": { - "@babel/types": "^7.14.5", + "@babel/types": "^7.14.8", "jsesc": "^2.5.1", "source-map": "^0.5.0" }, @@ -242,14 +233,14 @@ } }, "@babel/helper-create-class-features-plugin": { - "version": "7.14.6", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.6.tgz", - "integrity": "sha512-Z6gsfGofTxH/+LQXqYEK45kxmcensbzmk/oi8DmaQytlQCgqNZt9XQF8iqlI/SeXWVjaMNxvYvzaYw+kh42mDg==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.8.tgz", + "integrity": "sha512-bpYvH8zJBWzeqi1o+co8qOrw+EXzQ/0c74gVmY205AWXy9nifHrOg77y+1zwxX5lXE7Icq4sPlSQ4O2kWBrteQ==", "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.14.5", "@babel/helper-function-name": "^7.14.5", - "@babel/helper-member-expression-to-functions": "^7.14.5", + "@babel/helper-member-expression-to-functions": "^7.14.7", "@babel/helper-optimise-call-expression": "^7.14.5", "@babel/helper-replace-supers": "^7.14.5", "@babel/helper-split-export-declaration": "^7.14.5" @@ -265,6 +256,30 @@ "regexpu-core": "^4.7.1" } }, + "@babel/helper-define-polyfill-provider": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.3.tgz", + "integrity": "sha512-RH3QDAfRMzj7+0Nqu5oqgO5q9mFtQEVvCRsi8qCEfzLR9p2BHfn5FzhSB2oj1fF7I2+DcTORkYaQ6aTR9Cofew==", + "dev": true, + "requires": { + "@babel/helper-compilation-targets": "^7.13.0", + "@babel/helper-module-imports": "^7.12.13", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/traverse": "^7.13.0", + "debug": "^4.1.1", + "lodash.debounce": "^4.0.8", + "resolve": "^1.14.2", + "semver": "^6.1.2" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, "@babel/helper-explode-assignable-expression": { "version": "7.14.5", "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.14.5.tgz", @@ -322,19 +337,19 @@ } }, "@babel/helper-module-transforms": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.5.tgz", - "integrity": "sha512-iXpX4KW8LVODuAieD7MzhNjmM6dzYY5tfRqT+R9HDXWl0jPn/djKmA+G9s/2C2T9zggw5tK1QNqZ70USfedOwA==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.8.tgz", + "integrity": "sha512-RyE+NFOjXn5A9YU1dkpeBaduagTlZ0+fccnIcAGbv1KGUlReBj7utF7oEth8IdIBQPcux0DDgW5MFBH2xu9KcA==", "dev": true, "requires": { "@babel/helper-module-imports": "^7.14.5", "@babel/helper-replace-supers": "^7.14.5", - "@babel/helper-simple-access": "^7.14.5", + "@babel/helper-simple-access": "^7.14.8", "@babel/helper-split-export-declaration": "^7.14.5", - "@babel/helper-validator-identifier": "^7.14.5", + "@babel/helper-validator-identifier": "^7.14.8", "@babel/template": "^7.14.5", - "@babel/traverse": "^7.14.5", - "@babel/types": "^7.14.5" + "@babel/traverse": "^7.14.8", + "@babel/types": "^7.14.8" } }, "@babel/helper-optimise-call-expression": { @@ -376,12 +391,12 @@ } }, "@babel/helper-simple-access": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.14.5.tgz", - "integrity": "sha512-nfBN9xvmCt6nrMZjfhkl7i0oTV3yxR4/FztsbOASyTvVcoYd0TRHh7eMLdlEcCqobydC0LAF3LtC92Iwxo0wyw==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.14.8.tgz", + "integrity": "sha512-TrFN4RHh9gnWEU+s7JloIho2T76GPwRHhdzOWLqTrMnlas8T9O7ec+oEDNsRXndOmru9ymH9DFrEOxpzPoSbdg==", "dev": true, "requires": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.14.8" } }, "@babel/helper-skip-transparent-expression-wrappers": { @@ -403,9 +418,9 @@ } }, "@babel/helper-validator-identifier": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz", - "integrity": "sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", + "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==", "dev": true }, "@babel/helper-validator-option": { @@ -427,14 +442,14 @@ } }, "@babel/helpers": { - "version": "7.14.6", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.14.6.tgz", - "integrity": "sha512-yesp1ENQBiLI+iYHSJdoZKUtRpfTlL1grDIX9NRlAVppljLw/4tTyYupIB7uIYmC3stW/imAv8EqaKaS/ibmeA==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.14.8.tgz", + "integrity": "sha512-ZRDmI56pnV+p1dH6d+UN6GINGz7Krps3+270qqI9UJ4wxYThfAIcI5i7j5vXC4FJ3Wap+S9qcebxeYiqn87DZw==", "dev": true, "requires": { "@babel/template": "^7.14.5", - "@babel/traverse": "^7.14.5", - "@babel/types": "^7.14.5" + "@babel/traverse": "^7.14.8", + "@babel/types": "^7.14.8" } }, "@babel/highlight": { @@ -507,11 +522,22 @@ } }, "@babel/parser": { - "version": "7.14.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.7.tgz", - "integrity": "sha512-X67Z5y+VBJuHB/RjwECp8kSl5uYi0BvRbNeWqkaJCVh+LiTPl19WBUfG627psSgp9rSf6ojuXghQM3ha6qHHdA==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.8.tgz", + "integrity": "sha512-syoCQFOoo/fzkWDeM0dLEZi5xqurb5vuyzwIMNZRNun+N/9A4cUZeQaE7dTrB8jGaKuJRBtEOajtnmw0I5hvvA==", "dev": true }, + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.14.5.tgz", + "integrity": "sha512-ZoJS2XCKPBfTmL122iP6NM9dOg+d4lc9fFk3zxc8iDjvt8Pk4+TlsHSKhIPf6X+L5ORCdBzqMZDjL/WHj7WknQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.14.5", + "@babel/plugin-proposal-optional-chaining": "^7.14.5" + } + }, "@babel/plugin-proposal-async-generator-functions": { "version": "7.14.7", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.14.7.tgz", @@ -533,6 +559,17 @@ "@babel/helper-plugin-utils": "^7.14.5" } }, + "@babel/plugin-proposal-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.14.5.tgz", + "integrity": "sha512-KBAH5ksEnYHCegqseI5N9skTdxgJdmDoAOc0uXa+4QMYKeZD0w5IARh4FMlTNtaHhbB8v+KzMdTgxMMzsIy6Yg==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.14.5", + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/plugin-syntax-class-static-block": "^7.14.5" + } + }, "@babel/plugin-proposal-dynamic-import": { "version": "7.14.5", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.14.5.tgz", @@ -637,6 +674,18 @@ "@babel/helper-plugin-utils": "^7.14.5" } }, + "@babel/plugin-proposal-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-62EyfyA3WA0mZiF2e2IV9mc9Ghwxcg8YTu8BS4Wss4Y3PY725OmS9M0qLORbJwLqFtGh+jiE4wAmocK2CTUK2Q==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.14.5", + "@babel/helper-create-class-features-plugin": "^7.14.5", + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5" + } + }, "@babel/plugin-proposal-unicode-property-regex": { "version": "7.14.5", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.14.5.tgz", @@ -665,6 +714,15 @@ "@babel/helper-plugin-utils": "^7.12.13" } }, + "@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, "@babel/plugin-syntax-dynamic-import": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", @@ -746,6 +804,15 @@ "@babel/helper-plugin-utils": "^7.8.0" } }, + "@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, "@babel/plugin-syntax-top-level-await": { "version": "7.14.5", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", @@ -985,9 +1052,9 @@ } }, "@babel/plugin-transform-regenerator": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.12.1.tgz", - "integrity": "sha512-gYrHqs5itw6i4PflFX3OdBPMQdPbF4bj2REIUxlMRUFk0/ZOAIpDFuViuxPjUL7YC8UPnf+XG7/utJvqXdPKng==", + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.14.5.tgz", + "integrity": "sha512-NVIY1W3ITDP5xQl50NgTKlZ0GrotKtLna08/uGY6ErQt6VEQZXla86x/CTddm5gZdcr+5GSsvMeTmWA5Ii6pkg==", "dev": true, "requires": { "regenerator-transform": "^0.14.2" @@ -1068,92 +1135,90 @@ } }, "@babel/preset-env": { - "version": "7.12.17", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.12.17.tgz", - "integrity": "sha512-9PMijx8zFbCwTHrd2P4PJR5nWGH3zWebx2OcpTjqQrHhCiL2ssSR2Sc9ko2BsI2VmVBfoaQmPrlMTCui4LmXQg==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.14.8.tgz", + "integrity": "sha512-a9aOppDU93oArQ51H+B8M1vH+tayZbuBqzjOhntGetZVa+4tTu5jp+XTwqHGG2lxslqomPYVSjIxQkFwXzgnxg==", "dev": true, "requires": { - "@babel/compat-data": "^7.12.13", - "@babel/helper-compilation-targets": "^7.12.17", - "@babel/helper-module-imports": "^7.12.13", - "@babel/helper-plugin-utils": "^7.12.13", - "@babel/helper-validator-option": "^7.12.17", - "@babel/plugin-proposal-async-generator-functions": "^7.12.13", - "@babel/plugin-proposal-class-properties": "^7.12.13", - "@babel/plugin-proposal-dynamic-import": "^7.12.17", - "@babel/plugin-proposal-export-namespace-from": "^7.12.13", - "@babel/plugin-proposal-json-strings": "^7.12.13", - "@babel/plugin-proposal-logical-assignment-operators": "^7.12.13", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.13", - "@babel/plugin-proposal-numeric-separator": "^7.12.13", - "@babel/plugin-proposal-object-rest-spread": "^7.12.13", - "@babel/plugin-proposal-optional-catch-binding": "^7.12.13", - "@babel/plugin-proposal-optional-chaining": "^7.12.17", - "@babel/plugin-proposal-private-methods": "^7.12.13", - "@babel/plugin-proposal-unicode-property-regex": "^7.12.13", - "@babel/plugin-syntax-async-generators": "^7.8.0", + "@babel/compat-data": "^7.14.7", + "@babel/helper-compilation-targets": "^7.14.5", + "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-validator-option": "^7.14.5", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.14.5", + "@babel/plugin-proposal-async-generator-functions": "^7.14.7", + "@babel/plugin-proposal-class-properties": "^7.14.5", + "@babel/plugin-proposal-class-static-block": "^7.14.5", + "@babel/plugin-proposal-dynamic-import": "^7.14.5", + "@babel/plugin-proposal-export-namespace-from": "^7.14.5", + "@babel/plugin-proposal-json-strings": "^7.14.5", + "@babel/plugin-proposal-logical-assignment-operators": "^7.14.5", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5", + "@babel/plugin-proposal-numeric-separator": "^7.14.5", + "@babel/plugin-proposal-object-rest-spread": "^7.14.7", + "@babel/plugin-proposal-optional-catch-binding": "^7.14.5", + "@babel/plugin-proposal-optional-chaining": "^7.14.5", + "@babel/plugin-proposal-private-methods": "^7.14.5", + "@babel/plugin-proposal-private-property-in-object": "^7.14.5", + "@babel/plugin-proposal-unicode-property-regex": "^7.14.5", + "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-class-properties": "^7.12.13", - "@babel/plugin-syntax-dynamic-import": "^7.8.0", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-export-namespace-from": "^7.8.3", - "@babel/plugin-syntax-json-strings": "^7.8.0", + "@babel/plugin-syntax-json-strings": "^7.8.3", "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", "@babel/plugin-syntax-numeric-separator": "^7.10.4", - "@babel/plugin-syntax-object-rest-spread": "^7.8.0", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.0", - "@babel/plugin-syntax-optional-chaining": "^7.8.0", - "@babel/plugin-syntax-top-level-await": "^7.12.13", - "@babel/plugin-transform-arrow-functions": "^7.12.13", - "@babel/plugin-transform-async-to-generator": "^7.12.13", - "@babel/plugin-transform-block-scoped-functions": "^7.12.13", - "@babel/plugin-transform-block-scoping": "^7.12.13", - "@babel/plugin-transform-classes": "^7.12.13", - "@babel/plugin-transform-computed-properties": "^7.12.13", - "@babel/plugin-transform-destructuring": "^7.12.13", - "@babel/plugin-transform-dotall-regex": "^7.12.13", - "@babel/plugin-transform-duplicate-keys": "^7.12.13", - "@babel/plugin-transform-exponentiation-operator": "^7.12.13", - "@babel/plugin-transform-for-of": "^7.12.13", - "@babel/plugin-transform-function-name": "^7.12.13", - "@babel/plugin-transform-literals": "^7.12.13", - "@babel/plugin-transform-member-expression-literals": "^7.12.13", - "@babel/plugin-transform-modules-amd": "^7.12.13", - "@babel/plugin-transform-modules-commonjs": "^7.12.13", - "@babel/plugin-transform-modules-systemjs": "^7.12.13", - "@babel/plugin-transform-modules-umd": "^7.12.13", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.12.13", - "@babel/plugin-transform-new-target": "^7.12.13", - "@babel/plugin-transform-object-super": "^7.12.13", - "@babel/plugin-transform-parameters": "^7.12.13", - "@babel/plugin-transform-property-literals": "^7.12.13", - "@babel/plugin-transform-regenerator": "^7.12.13", - "@babel/plugin-transform-reserved-words": "^7.12.13", - "@babel/plugin-transform-shorthand-properties": "^7.12.13", - "@babel/plugin-transform-spread": "^7.12.13", - "@babel/plugin-transform-sticky-regex": "^7.12.13", - "@babel/plugin-transform-template-literals": "^7.12.13", - "@babel/plugin-transform-typeof-symbol": "^7.12.13", - "@babel/plugin-transform-unicode-escapes": "^7.12.13", - "@babel/plugin-transform-unicode-regex": "^7.12.13", - "@babel/preset-modules": "^0.1.3", - "@babel/types": "^7.12.17", - "core-js-compat": "^3.8.0", - "semver": "^5.5.0" - }, - "dependencies": { - "@babel/plugin-transform-regenerator": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.14.5.tgz", - "integrity": "sha512-NVIY1W3ITDP5xQl50NgTKlZ0GrotKtLna08/uGY6ErQt6VEQZXla86x/CTddm5gZdcr+5GSsvMeTmWA5Ii6pkg==", - "dev": true, - "requires": { - "regenerator-transform": "^0.14.2" - } - }, + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5", + "@babel/plugin-transform-arrow-functions": "^7.14.5", + "@babel/plugin-transform-async-to-generator": "^7.14.5", + "@babel/plugin-transform-block-scoped-functions": "^7.14.5", + "@babel/plugin-transform-block-scoping": "^7.14.5", + "@babel/plugin-transform-classes": "^7.14.5", + "@babel/plugin-transform-computed-properties": "^7.14.5", + "@babel/plugin-transform-destructuring": "^7.14.7", + "@babel/plugin-transform-dotall-regex": "^7.14.5", + "@babel/plugin-transform-duplicate-keys": "^7.14.5", + "@babel/plugin-transform-exponentiation-operator": "^7.14.5", + "@babel/plugin-transform-for-of": "^7.14.5", + "@babel/plugin-transform-function-name": "^7.14.5", + "@babel/plugin-transform-literals": "^7.14.5", + "@babel/plugin-transform-member-expression-literals": "^7.14.5", + "@babel/plugin-transform-modules-amd": "^7.14.5", + "@babel/plugin-transform-modules-commonjs": "^7.14.5", + "@babel/plugin-transform-modules-systemjs": "^7.14.5", + "@babel/plugin-transform-modules-umd": "^7.14.5", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.14.7", + "@babel/plugin-transform-new-target": "^7.14.5", + "@babel/plugin-transform-object-super": "^7.14.5", + "@babel/plugin-transform-parameters": "^7.14.5", + "@babel/plugin-transform-property-literals": "^7.14.5", + "@babel/plugin-transform-regenerator": "^7.14.5", + "@babel/plugin-transform-reserved-words": "^7.14.5", + "@babel/plugin-transform-shorthand-properties": "^7.14.5", + "@babel/plugin-transform-spread": "^7.14.6", + "@babel/plugin-transform-sticky-regex": "^7.14.5", + "@babel/plugin-transform-template-literals": "^7.14.5", + "@babel/plugin-transform-typeof-symbol": "^7.14.5", + "@babel/plugin-transform-unicode-escapes": "^7.14.5", + "@babel/plugin-transform-unicode-regex": "^7.14.5", + "@babel/preset-modules": "^0.1.4", + "@babel/types": "^7.14.8", + "babel-plugin-polyfill-corejs2": "^0.2.2", + "babel-plugin-polyfill-corejs3": "^0.2.2", + "babel-plugin-polyfill-regenerator": "^0.2.2", + "core-js-compat": "^3.15.0", + "semver": "^6.3.0" + }, + "dependencies": { "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true } } @@ -1172,9 +1237,9 @@ } }, "@babel/runtime": { - "version": "7.12.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.5.tgz", - "integrity": "sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.8.tgz", + "integrity": "sha512-twj3L8Og5SaCRCErB4x4ajbvBIVV77CGeFglHpeg5WC5FF8TZzBWXtTJ4MqaD9QszLYTtr+IsaAL2rEUevb+eg==", "dev": true, "requires": { "regenerator-runtime": "^0.13.4" @@ -1192,29 +1257,29 @@ } }, "@babel/traverse": { - "version": "7.14.7", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.7.tgz", - "integrity": "sha512-9vDr5NzHu27wgwejuKL7kIOm4bwEtaPQ4Z6cpCmjSuaRqpH/7xc4qcGEscwMqlkwgcXl6MvqoAjZkQ24uSdIZQ==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.8.tgz", + "integrity": "sha512-kexHhzCljJcFNn1KYAQ6A5wxMRzq9ebYpEDV4+WdNyr3i7O44tanbDOR/xjiG2F3sllan+LgwK+7OMk0EmydHg==", "dev": true, "requires": { "@babel/code-frame": "^7.14.5", - "@babel/generator": "^7.14.5", + "@babel/generator": "^7.14.8", "@babel/helper-function-name": "^7.14.5", "@babel/helper-hoist-variables": "^7.14.5", "@babel/helper-split-export-declaration": "^7.14.5", - "@babel/parser": "^7.14.7", - "@babel/types": "^7.14.5", + "@babel/parser": "^7.14.8", + "@babel/types": "^7.14.8", "debug": "^4.1.0", "globals": "^11.1.0" } }, "@babel/types": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz", - "integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", + "integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.14.5", + "@babel/helper-validator-identifier": "^7.14.8", "to-fast-properties": "^2.0.0" }, "dependencies": { @@ -1227,9 +1292,9 @@ } }, "@eslint/eslintrc": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.2.tgz", - "integrity": "sha512-8nmGq/4ycLpIwzvhI4tNDmQztZ8sp+hI7cyG8i1nQDhkAbRzHpXPidRAHlNvCZQpJTKw5ItIpMw9RSToGF00mg==", + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", + "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", "dev": true, "requires": { "ajv": "^6.12.4", @@ -1253,9 +1318,9 @@ } }, "globals": { - "version": "13.9.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.9.0.tgz", - "integrity": "sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA==", + "version": "13.10.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.10.0.tgz", + "integrity": "sha512-piHC3blgLGFjvOuMmWZX60f+na1lXFDhQXBf1UYp2fXPXqvEUbOhNwi6BsQ0bQishwedgnjkwv1d9zKf+MWw3g==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -1295,6 +1360,23 @@ } } }, + "@humanwhocodes/config-array": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", + "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.0", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + } + }, + "@humanwhocodes/object-schema": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz", + "integrity": "sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==", + "dev": true + }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -1455,9 +1537,9 @@ "dev": true }, "@nodelib/fs.walk": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.7.tgz", - "integrity": "sha512-BTIhocbPBSrRmHxOAJFtR18oLhxTtAFDAvL8hY1S3iU8k+E60W/YFs4jrixGzQjMpF4qPXxIQHcjVD9dz1C2QA==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "requires": { "@nodelib/fs.scandir": "2.1.5", @@ -1575,33 +1657,33 @@ "dev": true }, "@szmarczak/http-timer": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.5.tgz", - "integrity": "sha512-PyRA9sm1Yayuj5OIoJ1hGt2YISX45w9WcFbh6ddT0Z/0yaFxOtGLInr4jUfU1EAFVs0Yfyfev4RNwBlUaHdlDQ==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", + "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", "dev": true, "requires": { "defer-to-connect": "^2.0.0" } }, "@types/babel-types": { - "version": "7.0.9", - "resolved": "https://registry.npmjs.org/@types/babel-types/-/babel-types-7.0.9.tgz", - "integrity": "sha512-qZLoYeXSTgQuK1h7QQS16hqLGdmqtRmN8w/rl3Au/l5x/zkHx+a4VHrHyBsi1I1vtK2oBHxSzKIu0R5p6spdOA==", + "version": "7.0.10", + "resolved": "https://registry.npmjs.org/@types/babel-types/-/babel-types-7.0.10.tgz", + "integrity": "sha512-g7zrcqL4MiRu3jZzdZZYk0g0KcKk2fddXazSdP1PacEpmjihRsNGU50aaEKnPFuKzfN7WkRktUiCXvs4zU9XXQ==", "dev": true }, "@types/babylon": { - "version": "6.16.5", - "resolved": "https://registry.npmjs.org/@types/babylon/-/babylon-6.16.5.tgz", - "integrity": "sha512-xH2e58elpj1X4ynnKp9qSnWlsRTIs6n3tgLGNfwAGHwePw0mulHQllV34n0T25uYSu1k0hRKkWXF890B1yS47w==", + "version": "6.16.6", + "resolved": "https://registry.npmjs.org/@types/babylon/-/babylon-6.16.6.tgz", + "integrity": "sha512-G4yqdVlhr6YhzLXFKy5F7HtRBU8Y23+iWy7UKthMq/OSQnL1hbsoeXESQ2LY8zEDlknipDG3nRGhUC9tkwvy/w==", "dev": true, "requires": { "@types/babel-types": "*" } }, "@types/cacheable-request": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.1.tgz", - "integrity": "sha512-ykFq2zmBGOCbpIXtoVbz4SKY5QriWPh3AjyU4G74RYbtt5yOc5OfaY75ftjg7mikMOla1CTGpX3lLbuJh8DTrQ==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.2.tgz", + "integrity": "sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA==", "dev": true, "requires": { "@types/http-cache-semantics": "*", @@ -1617,42 +1699,36 @@ "dev": true }, "@types/http-cache-semantics": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz", - "integrity": "sha512-c3Xy026kOF7QOTn00hbIllV1dLR9hG9NkSrLQgCVs8NF6sBU+VGWjD3wLPhmh1TYAc7ugCFsvHYMN4VcBN1U1A==", - "dev": true - }, - "@types/json5": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", + "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==", "dev": true }, "@types/keyv": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.1.tgz", - "integrity": "sha512-MPtoySlAZQ37VoLaPcTHCu1RWJ4llDkULYZIzOYxlhxBqYPB0RsRlmMU0R6tahtFe27mIdkHV+551ZWV4PLmVw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.2.tgz", + "integrity": "sha512-/FvAK2p4jQOaJ6CGDHJTqZcUtbZe820qIeTg7o0Shg7drB4JHeL+V/dhSaly7NXx6u8eSee+r7coT+yuJEvDLg==", "dev": true, "requires": { "@types/node": "*" } }, "@types/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==", "dev": true }, "@types/node": { - "version": "15.14.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.14.0.tgz", - "integrity": "sha512-um/+/ip3QZmwLfIkWZSNtQIJNVAqrJ92OkLMeuZrjZMTAJniI7fh8N8OICyDhAJ2mzgk/fmYFo72jRr5HyZ1EQ==", + "version": "16.4.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.4.6.tgz", + "integrity": "sha512-FKyawK3o5KL16AwbeFajen8G4K3mmqUrQsehn5wNKs8IzlKHE8TfnSmILXVMVziAEcnB23u1RCFU1NT6hSyr7Q==", "dev": true }, "@types/normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", + "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", "dev": true }, "@types/parse-json": { @@ -1662,9 +1738,9 @@ "dev": true }, "@types/puppeteer": { - "version": "5.4.3", - "resolved": "https://registry.npmjs.org/@types/puppeteer/-/puppeteer-5.4.3.tgz", - "integrity": "sha512-3nE8YgR9DIsgttLW+eJf6mnXxq8Ge+27m5SU3knWmrlfl6+KOG0Bf9f7Ua7K+C4BnaTMAh3/UpySqdAYvrsvjg==", + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/@types/puppeteer/-/puppeteer-5.4.4.tgz", + "integrity": "sha512-3Nau+qi69CN55VwZb0ATtdUAlYlqOOQ3OfQfq0Hqgc4JMFXiQT/XInlwQ9g6LbicDslE6loIFsXFklGh5XmI6Q==", "dev": true, "requires": { "@types/node": "*" @@ -1680,9 +1756,9 @@ } }, "@types/q": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.4.tgz", - "integrity": "sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug==", + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.5.tgz", + "integrity": "sha512-L28j2FcJfSZOnL1WBjDYp2vUHCeIFlyYI/53EwD/rKUBQ7MtUUfbQWiyKJGpcnv4/WgrhWsFKrcPstcAt/J0tQ==", "dev": true }, "@types/resolve": { @@ -1704,9 +1780,9 @@ } }, "@types/unist": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.3.tgz", - "integrity": "sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz", + "integrity": "sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==", "dev": true }, "@types/which": { @@ -2026,9 +2102,9 @@ } }, "acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true }, "acorn-node": { @@ -2888,6 +2964,44 @@ "object.assign": "^4.1.0" } }, + "babel-plugin-polyfill-corejs2": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.2.tgz", + "integrity": "sha512-kISrENsJ0z5dNPq5eRvcctITNHYXWOA4DUZRFYCz3jYCcvTb/A546LIddmoGNMVYg2U38OyFeNosQwI9ENTqIQ==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.13.11", + "@babel/helper-define-polyfill-provider": "^0.2.2", + "semver": "^6.1.1" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "babel-plugin-polyfill-corejs3": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.4.tgz", + "integrity": "sha512-z3HnJE5TY/j4EFEa/qpQMSbcUJZ5JQi+3UFjXzn6pQCmIKc5Ug5j98SuYyH+m4xQnvKlMDIW4plLfgyVnd0IcQ==", + "dev": true, + "requires": { + "@babel/helper-define-polyfill-provider": "^0.2.2", + "core-js-compat": "^3.14.0" + } + }, + "babel-plugin-polyfill-regenerator": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.2.tgz", + "integrity": "sha512-Goy5ghsc21HgPDFtzRkSirpZVW35meGoTmTOb2bxqdl60ghub4xOidgNTHaZfQ2FaxQsKmwvXtOAkcIS4SMBWg==", + "dev": true, + "requires": { + "@babel/helper-define-polyfill-provider": "^0.2.2" + } + }, "babel-runtime": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", @@ -3574,13 +3688,13 @@ "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==" }, "browser-sync": { - "version": "2.27.4", - "resolved": "https://registry.npmjs.org/browser-sync/-/browser-sync-2.27.4.tgz", - "integrity": "sha512-zgjrI6oUXxLa671SxVmWfIH+XiG6yZiGuvsQ1huuGEBlKkWuBVKgYjh+j9kagKm891FARgmK4Ct4PAhckLKaYg==", + "version": "2.27.5", + "resolved": "https://registry.npmjs.org/browser-sync/-/browser-sync-2.27.5.tgz", + "integrity": "sha512-0GMEPDqccbTxwYOUGCk5AZloDj9I/1eDZCLXUKXu7iBJPznGGOnMHs88mrhaFL0fTA0R23EmsXX9nLZP+k5YzA==", "dev": true, "requires": { - "browser-sync-client": "^2.27.4", - "browser-sync-ui": "^2.27.4", + "browser-sync-client": "^2.27.5", + "browser-sync-ui": "^2.27.5", "bs-recipes": "1.3.4", "bs-snippet-injector": "^2.0.1", "chokidar": "^3.5.1", @@ -3748,9 +3862,9 @@ } }, "browser-sync-client": { - "version": "2.27.4", - "resolved": "https://registry.npmjs.org/browser-sync-client/-/browser-sync-client-2.27.4.tgz", - "integrity": "sha512-l0krAGZnpLaD+tUYdM25WeS4FP73ZoPeaxlVzOvmtL9uKSlvpmywsnDwa3PJzc3ubmDPAcD74ifJjl6MmVksXw==", + "version": "2.27.5", + "resolved": "https://registry.npmjs.org/browser-sync-client/-/browser-sync-client-2.27.5.tgz", + "integrity": "sha512-l2jtf60/exv0fQiZkhi3z8RgexYYLGS7DVDnyepkrp+oFAPlKW69daL6NrVSgrwu6lzSTCCTAiPXnUSrQ57e/Q==", "dev": true, "requires": { "etag": "1.8.1", @@ -3760,9 +3874,9 @@ } }, "browser-sync-ui": { - "version": "2.27.4", - "resolved": "https://registry.npmjs.org/browser-sync-ui/-/browser-sync-ui-2.27.4.tgz", - "integrity": "sha512-E58Mb6ycz57Nm393oqVJj4jxuLJH3MhZnY8AV+zd9LsNVGZjrKRNNIw5JPYYguyb37ZjLjq2x4u+38mRv3Sb7g==", + "version": "2.27.5", + "resolved": "https://registry.npmjs.org/browser-sync-ui/-/browser-sync-ui-2.27.5.tgz", + "integrity": "sha512-KxBJhQ6XNbQ8w8UlkPa9/J5R0nBHgHuJUtDpEXQx1jBapDy32WGzD0NENDozP4zGNvJUgZk3N80hqB7YCieC3g==", "dev": true, "requires": { "async-each-series": "0.1.1", @@ -4379,9 +4493,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001241", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001241.tgz", - "integrity": "sha512-1uoSZ1Pq1VpH0WerIMqwptXHNNGfdl7d1cJUFs80CwQ/lVzdhTvsFZCeNFslze7AjsQnb4C85tzclPa1VShbeQ==", + "version": "1.0.30001248", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001248.tgz", + "integrity": "sha512-NwlQbJkxUFJ8nMErnGtT0QTM2TJ33xgz4KXJSMIrjXIbDVdaYueGyjOrLKRtJC+rTiWfi6j5cnZN1NBiSBJGNw==", "dev": true }, "canvas": { @@ -4924,13 +5038,13 @@ } }, "color": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/color/-/color-3.1.3.tgz", - "integrity": "sha512-xgXAcTHa2HeFCGLE9Xs/R82hujGtu9Jd9x4NW3T34+OMs7VoPsjwzRczKHvTAHeJwWFwX5j15+MgAppE8ztObQ==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", + "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", "dev": true, "requires": { - "color-convert": "^1.9.1", - "color-string": "^1.5.4" + "color-convert": "^1.9.3", + "color-string": "^1.6.0" }, "dependencies": { "color-convert": { @@ -4970,9 +5084,9 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "color-string": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.5.tgz", - "integrity": "sha512-jgIoum0OfQfq9Whcfc2z/VhCNcmQjWbey6qBX0vqt7YICflUmBCh9E9CiQD5GSJ+Uehixm3NUwHVhqUAWRivZg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.6.0.tgz", + "integrity": "sha512-c/hGS+kRWJutUBEngKKmk4iH3sD59MBkoxVapS/0wgpCz2u7XsNloxknyvBhzwEs1IbV36D9PwqLPJ2DTu3vMA==", "dev": true, "requires": { "color-name": "^1.0.0", @@ -6752,9 +6866,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.3.765", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.765.tgz", - "integrity": "sha512-4NhcsfZYlr1x4FehYkK+R9CNNTOZ8vLcIu8Y1uWehxYp5r/jlCGAfBqChIubEfdtX+rBQpXx4yJuX/dzILH/nw==", + "version": "1.3.790", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.790.tgz", + "integrity": "sha512-epMH/S2MkhBv+Y0+nHK8dC7bzmOaPwcmiYqt+VwxSUJLgPzkqZnGUEQ8eVhy5zGmgWm9tDDdXkHDzOEsVU979A==", "dev": true }, "elliptic": { @@ -7035,13 +7149,14 @@ } }, "eslint": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.29.0.tgz", - "integrity": "sha512-82G/JToB9qIy/ArBzIWG9xvvwL3R86AlCjtGw+A29OMZDqhTybz/MByORSukGxeI+YPCR4coYyITKk8BFH9nDA==", + "version": "7.31.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.31.0.tgz", + "integrity": "sha512-vafgJpSh2ia8tnTkNUkwxGmnumgckLh5aAbLa1xRmIn9+owi8qBNGKL+B881kNKNTy7FFqTEkpNkUvmw0n6PkA==", "dev": true, "requires": { "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.2", + "@eslint/eslintrc": "^0.4.3", + "@humanwhocodes/config-array": "^0.5.0", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -7106,9 +7221,9 @@ "dev": true }, "globals": { - "version": "13.9.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.9.0.tgz", - "integrity": "sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA==", + "version": "13.10.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.10.0.tgz", + "integrity": "sha512-piHC3blgLGFjvOuMmWZX60f+na1lXFDhQXBf1UYp2fXPXqvEUbOhNwi6BsQ0bQishwedgnjkwv1d9zKf+MWw3g==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -7918,9 +8033,9 @@ "dev": true }, "fast-glob": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.6.tgz", - "integrity": "sha512-GnLuqj/pvQ7pX8/L4J84nijv6sAnlwvSDpMkJi9i7nPmPxGtRPkBSStfvDW5l6nMdX9VWe+pkKWFTgD+vF2QSQ==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", + "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", @@ -7943,15 +8058,15 @@ "dev": true }, "fast-safe-stringify": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", - "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.8.tgz", + "integrity": "sha512-lXatBjf3WPjmWD6DpIZxkeSsCOwqI0maYMpgDlx8g4U2qi4lbjA9oH/HD2a87G+KfsUmo5WbJFmqBZlPxtptag==", "dev": true }, "fastq": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", - "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.1.tgz", + "integrity": "sha512-HOnr8Mc60eNYl1gzwp6r5RoUyAn5/glBolUzP/Ez6IFVPMPirxn/9phgL6zhOtaTy7ISwPvQ+wT+hfcRZh/bzw==", "dev": true, "requires": { "reusify": "^1.0.4" @@ -8314,9 +8429,9 @@ } }, "flatted": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.0.tgz", - "integrity": "sha512-XprP7lDrVT+kE2c2YlfiV+IfS9zxukiIOvNamPNsImNhXadSsQEbosItdL9bUQlCZXR13SvPk20BjWSWLA7m4A==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.2.tgz", + "integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==", "dev": true }, "flush-write-stream": { @@ -9173,9 +9288,9 @@ }, "dependencies": { "is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true }, "type-fest": { @@ -9936,9 +10051,9 @@ } }, "is-core-module": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz", - "integrity": "sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.5.0.tgz", + "integrity": "sha512-TXCMSDsEHMEEZ6eCA8rwRDbLu55MRGmrctljsBX/2v1d9/GzqHOxW5c5oPSgrUt2vBFXebu9rGqckXGPWOlYpg==", "dev": true, "requires": { "has": "^1.0.3" @@ -10801,12 +10916,12 @@ "dev": true }, "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", "dev": true, "requires": { - "minimist": "^1.2.0" + "minimist": "^1.2.5" } }, "jsonc-parser": { @@ -11294,13 +11409,13 @@ } }, "lighthouse-logger": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/lighthouse-logger/-/lighthouse-logger-1.2.0.tgz", - "integrity": "sha512-wzUvdIeJZhRsG6gpZfmSCfysaxNEr43i+QT+Hie94wvHDKFLi4n7C2GqZ4sTC+PH5b5iktmXJvU87rWvhP3lHw==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/lighthouse-logger/-/lighthouse-logger-1.3.0.tgz", + "integrity": "sha512-BbqAKApLb9ywUli+0a+PcV04SyJ/N1q/8qgCNe6U97KbPCS1BTksEuHFLYdvc8DltuhfxIUBqDZsC0bBGtl3lA==", "dev": true, "requires": { - "debug": "^2.6.8", - "marky": "^1.2.0" + "debug": "^2.6.9", + "marky": "^1.2.2" }, "dependencies": { "debug": { @@ -11420,9 +11535,9 @@ } }, "is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true }, "npm-run-path": { @@ -11505,9 +11620,9 @@ } }, "listr2": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.10.0.tgz", - "integrity": "sha512-eP40ZHihu70sSmqFNbNy2NL1YwImmlMmPh9WO5sLmPDleurMHt3n+SwEWNu2kzKScexZnkyFtc1VI0z/TGlmpw==", + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.11.0.tgz", + "integrity": "sha512-XLJVe2JgXCyQTa3FbSv11lkKExYmEyA4jltVo8z4FX10Vt1Yj8IMekBfwim0BSOM9uj1QMTJvDQQpHyuPbB/dQ==", "dev": true, "requires": { "cli-truncate": "^2.1.0", @@ -11575,6 +11690,17 @@ "big.js": "^5.2.2", "emojis-list": "^3.0.0", "json5": "^1.0.1" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + } } }, "localtunnel": { @@ -11627,6 +11753,12 @@ "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", "dev": true }, + "lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", + "dev": true + }, "lodash.defaults": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", @@ -11911,9 +12043,9 @@ } }, "luxon": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/luxon/-/luxon-1.27.0.tgz", - "integrity": "sha512-VKsFsPggTA0DvnxtJdiExAucKdAnwbCCNlMM5ENvHlxubqWd0xhZcdb4XgZ7QFNhaRhilXCFxHuoObP5BNA4PA==", + "version": "1.28.0", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-1.28.0.tgz", + "integrity": "sha512-TfTiyvZhwBYM/7QdAVDh+7dBTBA29v4ik0Ce9zda3Mnf8on1S5KJI8P2jKFZ8+5C0jhmr0KwJEO/Wdpm0VeWJQ==", "dev": true }, "magic-string": { @@ -12051,12 +12183,12 @@ "dev": true }, "markdown-it-prism": { - "version": "2.1.7", - "resolved": "https://registry.npmjs.org/markdown-it-prism/-/markdown-it-prism-2.1.7.tgz", - "integrity": "sha512-ohc9di/Akoe/UwHeVY0BftX2oxIn5XQdsjM3DME/j7aFHVPpoWltJvT2D86uoGiUVo6SBH8cuNBcUG8gacW0LQ==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/markdown-it-prism/-/markdown-it-prism-2.1.8.tgz", + "integrity": "sha512-PBiqlX3zGPQnOk7q7TkeveQfXlqzhjfHg2zSwntDNauYY7KFhg2FzO6O+1boillQptEBcIaEAO9gwKq/tXGHUQ==", "dev": true, "requires": { - "prismjs": "1.24.0" + "prismjs": "1.24.1" } }, "markdown-link": { @@ -12533,18 +12665,18 @@ "dev": true }, "mime-db": { - "version": "1.48.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.48.0.tgz", - "integrity": "sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ==", + "version": "1.49.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz", + "integrity": "sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==", "dev": true }, "mime-types": { - "version": "2.1.31", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.31.tgz", - "integrity": "sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg==", + "version": "2.1.32", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.32.tgz", + "integrity": "sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==", "dev": true, "requires": { - "mime-db": "1.48.0" + "mime-db": "1.49.0" } }, "mimic-fn": { @@ -12846,9 +12978,9 @@ "dev": true }, "needle": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.7.0.tgz", - "integrity": "sha512-b4f4JgOl7GZVM1p+xuWBAsHwflng1s2yOu9lOThKAzULRW7eqSFYfN4gbuUFOMuE0hVAPWJnSz/90LMOlEGErw==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/needle/-/needle-2.8.0.tgz", + "integrity": "sha512-ZTq6WYkN/3782H1393me3utVYdq2XyqNUFBsprEE3VMAT0+hP/cItpnITpqsY6ep2yeFE4Tqtqwc74VqUlUYtw==", "dev": true, "requires": { "debug": "^3.2.6", @@ -13676,9 +13808,9 @@ } }, "object-inspect": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.3.tgz", - "integrity": "sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz", + "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==", "dev": true }, "object-keys": { @@ -15467,9 +15599,9 @@ "dev": true }, "prismjs": { - "version": "1.24.0", - "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.24.0.tgz", - "integrity": "sha512-SqV5GRsNqnzCL8k5dfAjCNhUrF3pR0A9lTDSCUZeh/LIshheXJEaP0hwLz2t4XHivd2J/v2HR+gRnigzeKe3cQ==", + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.24.1.tgz", + "integrity": "sha512-mNPsedLuk90RVJioIky8ANZEwYm5w9LcvCXrxHlwf4fNVSn8jEipMybMkWUyyF0JhnC+C4VcOVSBuHRKs1L5Ow==", "dev": true }, "process": { @@ -16611,9 +16743,9 @@ } }, "resolve-alpn": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.1.2.tgz", - "integrity": "sha512-8OyfzhAtA32LVUsJSke3auIyINcwdh5l3cvYKdKO0nvsYSKuiLfTM5i78PJswFPT8y6cPW+L1v6/hE95chcpDA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.0.tgz", + "integrity": "sha512-e4FNQs+9cINYMO5NMFc6kOUCdohjqFPSgMuwuZAOUWqrfWsen+Yjy5qZFkV5K7VO7tFSLKcUL97olkED7sCBHA==", "dev": true }, "resolve-cwd": { @@ -16813,9 +16945,9 @@ } }, "rollup": { - "version": "2.52.7", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.52.7.tgz", - "integrity": "sha512-55cSH4CCU6MaPr9TAOyrIC+7qFCHscL7tkNsm1MBfIJRRqRbCEY0mmeFn4Wg8FKsHtEH8r389Fz38r/o+kgXLg==", + "version": "2.55.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.55.0.tgz", + "integrity": "sha512-Atc3QqelKzrKwRkqnSdq0d2Mi8e0iGuL+kZebKMZ4ysyWHD5hw9VfVCAuODIW5837RENV8LXcbAEHurYf+ArvA==", "dev": true, "requires": { "fsevents": "~2.3.2" @@ -17708,9 +17840,9 @@ } }, "slugify": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/slugify/-/slugify-1.5.3.tgz", - "integrity": "sha512-/HkjRdwPY3yHJReXu38NiusZw2+LLE2SrhkWJtmlPDB1fqFSvioYj62NkPcrKiNCgRLeGcGK7QBvr1iQwybeXw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/slugify/-/slugify-1.6.0.tgz", + "integrity": "sha512-FkMq+MQc5hzYgM86nLuHI98Acwi3p4wX+a5BO9Hhw4JdK4L7WueIiZ4tXEobImPqBz2sVcV0+Mu3GRB30IGang==", "dev": true }, "snake-case": { @@ -18943,9 +19075,9 @@ }, "dependencies": { "ajv": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.0.tgz", - "integrity": "sha512-cnUG4NSBiM4YFBxgZIj/In3/6KX+rQ2l2YPRVcvAMQGWEPKuXoPIhxzwqh31jA3IPbI4qEOp/5ILI4ynioXsGQ==", + "version": "8.6.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.2.tgz", + "integrity": "sha512-9807RlWAgT564wT+DjeyU5OFMPjmzxVobvDFmNAhY+5zD6A2ly3jDp6sgnfyDtlIQ+7H97oc/DGCzzfu9rjw9w==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -18992,9 +19124,9 @@ "dev": true }, "tar": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.0.tgz", - "integrity": "sha512-DUCttfhsnLCjwoDoFcI+B2iJgYa93vBnDUATYEeRx6sntCTdN01VnqsIuTlALXla/LWooNg0yEGeB+Y8WdFxGA==", + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.2.tgz", + "integrity": "sha512-EwKEgqJ7nJoS+s8QfLYVGMDmAsj+StbI2AM/RTHeUSsOw6Z8bwNBRv5z3CY0m7laC5qUAqruLX5AhMuc5deY3Q==", "dev": true, "requires": { "chownr": "^2.0.0", @@ -19671,13 +19803,12 @@ "dev": true }, "tsconfig-paths": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", - "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.10.1.tgz", + "integrity": "sha512-rETidPDgCpltxF7MjBZlAFPUHv5aHH2MymyPvh+vEyWAED4Eb/WeMbsnD/JDr4OKPOA1TssDHgIcpTN5Kh0p6Q==", "dev": true, "requires": { - "@types/json5": "^0.0.29", - "json5": "^1.0.1", + "json5": "^2.2.0", "minimist": "^1.2.0", "strip-bom": "^3.0.0" }, @@ -19782,9 +19913,9 @@ "dev": true }, "uglify-js": { - "version": "3.13.10", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.10.tgz", - "integrity": "sha512-57H3ACYFXeo1IaZ1w02sfA71wI60MGco/IQFjOqK+WtKoprh7Go2/yvd2HPtoJILO2Or84ncLccI4xoHMTSbGg==", + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.1.tgz", + "integrity": "sha512-JhS3hmcVaXlp/xSo3PKY5R0JqKs5M3IV+exdLHW99qKvKivPO4Z8qbej6mte17SOPqAOVMjt/XGgWacnFSzM3g==", "dev": true }, "uglify-to-browserify": { @@ -19946,9 +20077,9 @@ "dev": true }, "unified": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/unified/-/unified-9.2.1.tgz", - "integrity": "sha512-juWjuI8Z4xFg8pJbnEZ41b5xjGUWGHqXALmBZ3FC3WX0PIx1CZBIIJ6mXbYMcf6Yw4Fi0rFUTA1cdz/BglbOhA==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-9.2.2.tgz", + "integrity": "sha512-Sg7j110mtefBD+qunSLO1lqOEKdrwBFBrR6Qd8f4uwkhWNlbkaqwHse6e7QvD3AP/MNoJdEDLaf8OxYyoWgorQ==", "dev": true, "requires": { "bail": "^1.0.0", @@ -20591,9 +20722,9 @@ } }, "urijs": { - "version": "1.19.6", - "resolved": "https://registry.npmjs.org/urijs/-/urijs-1.19.6.tgz", - "integrity": "sha512-eSXsXZ2jLvGWeLYlQA3Gh36BcjF+0amo92+wHPyN1mdR8Nxf75fuEuYTd9c0a+m/vhCjRK0ESlE9YNLW+E1VEw==", + "version": "1.19.7", + "resolved": "https://registry.npmjs.org/urijs/-/urijs-1.19.7.tgz", + "integrity": "sha512-Id+IKjdU0Hx+7Zx717jwLPsPeUqz7rAtuVBRLLs+qn+J2nf9NGITWVCxcijgYxBqe83C7sqsQPs6H1pyz3x9gA==", "dev": true }, "urix": { @@ -20636,9 +20767,9 @@ "dev": true }, "urltools": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/urltools/-/urltools-0.4.1.tgz", - "integrity": "sha512-hGdweXMDjRXC0wC9RiJRRY05cAvlg6hnGBSg+6KWjJcqtvO0F6D4S2+ftp6t9x761jW8C0/lnKUOVUeA3rZlZQ==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/urltools/-/urltools-0.4.2.tgz", + "integrity": "sha512-nsAASNzc1+n8MZuQ335Oa9z8KOCtDNfiQzFOAYCiu+IPZQVD0FH6n9hP/NKygKxs5nmRYnj8ftYKgyNcJKlgUw==", "dev": true, "requires": { "glob": "^7.0.3", diff --git a/package.json b/package.json index 48da12cac8..d1b201b421 100644 --- a/package.json +++ b/package.json @@ -81,11 +81,7 @@ "devDependencies": { "@11ty/eleventy": "^0.11.0", "@11ty/eleventy-plugin-inclusive-language": "^1.0.0", - "@babel/preset-env": "7.12.17", - "@babel/plugin-transform-regenerator": "7.12.1", - "regenerator-transform": "0.14.5", - "@babel/runtime": "7.12.5", - "regenerator-runtime": "0.13.7", + "@babel/preset-env": "^7.14.8", "@mocha/docdash": "^3.0.1", "@rollup/plugin-babel": "^5.1.0", "@rollup/plugin-commonjs": "^14.0.0", @@ -137,6 +133,7 @@ "nyc": "^15.1.0", "pidtree": "^0.5.0", "prettier": "^1.19.1", + "regenerator-runtime": "0.13.7", "remark": "^12.0.1", "remark-github": "^9.0.1", "remark-inline-links": "^4.0.0", From 09ffc30b43db53b0cb3f54670132270271d8fe97 Mon Sep 17 00:00:00 2001 From: "JeongHoon Byun (a.k.a Outsider)" Date: Thu, 5 Aug 2021 20:48:58 +0900 Subject: [PATCH 03/10] Set CSP on karma to prevent 'evalError' regression (#4706) Signed-off-by: Outsider --- karma.conf.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/karma.conf.js b/karma.conf.js index f94dbdba88..46ce0ab243 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -72,6 +72,13 @@ const baseConfig = { mochaReporter: { showDiff: true }, + customHeaders: [ + { + match: '.*.html', + name: 'Content-Security-Policy', + value: "script-src https: 'self' 'unsafe-inline'" + } + ], customLaunchers: { ChromeDebug: { base: 'Chrome', From 9f82ccbd1efa35b8007fcefaa56f563f5145ae42 Mon Sep 17 00:00:00 2001 From: Juerg B <44573692+juergba@users.noreply.github.com> Date: Fri, 13 Aug 2021 11:31:58 +0200 Subject: [PATCH 04/10] chore(gha): update 'stale.yml' (#4718) [ci skip] --- .github/workflows/stale.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 7a4088b2dd..f3dd1cf14f 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -8,7 +8,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v3 + - uses: actions/stale@v4 with: days-before-stale: 120 days-before-close: 14 @@ -22,3 +22,4 @@ jobs: Thanks for contributing to Mocha! exempt-issue-labels: browser,chore,confirmed-bug,developer-experience,documentation,faq,feature,future,good-first-issue,help wanted,nice-to-have,qa,reporter,unconfirmed-bug,usability exempt-pr-labels: browser,chore,confirmed-bug,developer-experience,documentation,faq,feature,future,needs-review,nice-to-have,qa,reporter,semver-major,semver-minor,semver-patch,usability + operations-per-run: 200 From f19d3ca672e71950788bb577a7f3fb1cbf6c2d1b Mon Sep 17 00:00:00 2001 From: Juerg B <44573692+juergba@users.noreply.github.com> Date: Fri, 13 Aug 2021 16:21:14 +0200 Subject: [PATCH 05/10] docs: remove unsupported 'no-timeout' option (#4719) [ci skip] --- docs/index.md | 6 +++--- example/config/.mocharc.js | 8 ++++---- example/config/.mocharc.yml | 9 ++++----- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/docs/index.md b/docs/index.md index 86497d0ab1..1c26cea1d0 100644 --- a/docs/index.md +++ b/docs/index.md @@ -937,13 +937,13 @@ Note: A test that executes for _half_ of the "slow" time will be highlighted _in ### `--timeout , -t ` -> _Update in v6.0.0: `--no-timeout` is implied when invoking Mocha using inspect flags. It is equivalent to `--timeout 0`. `--timeout 99999999` is no longer needed._ +> _Update in v6.0.0: `--timeout 0` is implied when invoking Mocha using inspect flags. `--timeout 99999999` is no longer needed._ Specifies the test case timeout, defaulting to two (2) seconds (2000 milliseconds). Tests taking longer than this amount of time will be marked as failed. To override you may pass the timeout in milliseconds, or a value with the `s` suffix, e.g., `--timeout 2s` and `--timeout 2000` are equivalent. -To disable timeouts, use `--no-timeout`. +To disable timeouts, use `--timeout 0`. Note: synchronous (blocking) tests are also bound by the timeout, but they will not complete until the code stops blocking. Infinite loops will still be infinite loops! @@ -1174,7 +1174,7 @@ Use `inspect` to launch Node.js' internal debugger. All of these options are mutually exclusive. -Implies `--no-timeout`. +Implies `--timeout 0`. ### `--parallel, -p` diff --git a/example/config/.mocharc.js b/example/config/.mocharc.js index bdd89e769f..e80004a9dc 100644 --- a/example/config/.mocharc.js +++ b/example/config/.mocharc.js @@ -13,14 +13,14 @@ module.exports = { delay: false, diff: true, exit: false, // could be expressed as "'no-exit': true" - extension: ['js'], - // fgrep: something, // fgrep and grep are mutually exclusive + extension: ['js', 'cjs', 'mjs'], + fgrep: 'something', // fgrep and grep are mutually exclusive file: ['/path/to/some/file', '/path/to/some/other/file'], 'forbid-only': false, 'forbid-pending': false, 'full-trace': false, global: ['jQuery', '$'], - // grep: something, // fgrep and grep are mutually exclusive + grep: /something/i, // also 'something', fgrep and grep are mutually exclusive growl: false, ignore: ['/path/to/some/ignored/file'], 'inline-diffs': false, @@ -38,7 +38,7 @@ module.exports = { sort: false, spec: ['test/**/*.spec.js'], // the positional arguments! timeout: '2000', // same as "timeout: '2s'" - // timeout: false, // same as "'no-timeout': true" or "timeout: 0" + // timeout: false, // same as "timeout: 0" 'trace-warnings': true, // node flags ok ui: 'bdd', 'v8-stack-trace-limit': 100, // V8 flags are prepended with "v8-" diff --git a/example/config/.mocharc.yml b/example/config/.mocharc.yml index 4ba30dff22..c1e13a5d35 100644 --- a/example/config/.mocharc.yml +++ b/example/config/.mocharc.yml @@ -7,10 +7,9 @@ color: true delay: false diff: true exit: false # could be expressed as "no-exit: true" -extension: - - 'js' +extension: ['js', 'cjs', 'mjs'] # fgrep and grep are mutually exclusive -# fgrep: something +fgrep: 'something' file: - '/path/to/some/file' - '/path/to/some/other/file' @@ -21,7 +20,7 @@ global: - 'jQuery' - '$' # fgrep and grep are mutually exclusive -# grep: something +grep: '/something/i' # also 'something' growl: false ignore: - '/path/to/some/ignored/file' @@ -45,7 +44,7 @@ sort: false spec: - 'test/**/*.spec.js' # the positional arguments! timeout: '2000' # same as "timeout: '2s'" -# timeout: false # same as "no-timeout: true" or "timeout: 0" +# timeout: false # same as "timeout: 0" trace-warnings: true # node flags ok ui: 'bdd' v8-stack-trace-limit: 100 # V8 flags are prepended with "v8-" From 757b85dd230079901b181c68f0be82b9a3de6407 Mon Sep 17 00:00:00 2001 From: Juerg B <44573692+juergba@users.noreply.github.com> Date: Sat, 14 Aug 2021 18:07:05 +0200 Subject: [PATCH 06/10] docs: improve 'grep()' and clarify docs (#4714) --- docs/index.md | 7 +++++-- example/config/.mocharc.js | 3 ++- lib/mocha.js | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/index.md b/docs/index.md index 1c26cea1d0..b0c22608c6 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1138,9 +1138,12 @@ Cause Mocha to only run tests matching the given `regexp`, which is internally c Suppose, for example, you have "api" related tests, as well as "app" related tests, as shown in the following snippet; One could use `--grep api` or `--grep app` to run one or the other. The same goes for any other part of a suite or test-case title, `--grep users` would be valid as well, or even `--grep GET`. +And another option with double quotes: `--grep "groupA|groupB"`.
+And for more complex criterias: `--grep "/get/i"`. Some shells as e.g. Git-Bash-for-Windows may require: `--grep "'/get/i'"`. Using flags other than the `ignoreCase /i` (especially `/g` and `/y`) may lead to unpredictable results. + ```js describe('api', function() { - describe('GET /api/users', function() { + describe('GET /api/users groupA', function() { it('respond with an array of users', function() { // ... }); @@ -1148,7 +1151,7 @@ describe('api', function() { }); describe('app', function() { - describe('GET /users', function() { + describe('GET /users groupB', function() { it('respond with an array of users', function() { // ... }); diff --git a/example/config/.mocharc.js b/example/config/.mocharc.js index e80004a9dc..402ec03565 100644 --- a/example/config/.mocharc.js +++ b/example/config/.mocharc.js @@ -1,7 +1,8 @@ 'use strict'; // This is a JavaScript-based config file containing every Mocha option plus others. -// If you need conditional logic, you might want to use this type of config. +// If you need conditional logic, you might want to use this type of config, +// e.g. set options via environment variables 'process.env'. // Otherwise, JSON or YAML is recommended. module.exports = { diff --git a/lib/mocha.js b/lib/mocha.js index 62a414a9fa..b36210d60e 100644 --- a/lib/mocha.js +++ b/lib/mocha.js @@ -581,7 +581,7 @@ Mocha.prototype.fgrep = function(str) { Mocha.prototype.grep = function(re) { if (utils.isString(re)) { // extract args if it's regex-like, i.e: [string, pattern, flag] - var arg = re.match(/^\/(.*)\/(g|i|)$|.*/); + var arg = re.match(/^\/(.*)\/([gimy]{0,4})$|.*/); this.options.grep = new RegExp(arg[1] || arg[0], arg[2]); } else { this.options.grep = re; From bbf0c11b29544de91a18c1bd667c975ee44b7c90 Mon Sep 17 00:00:00 2001 From: Juerg B <44573692+juergba@users.noreply.github.com> Date: Mon, 16 Aug 2021 14:38:14 +0200 Subject: [PATCH 07/10] feat: add new option 'fail-zero' (#4716) --- docs/index.md | 23 +++++--- example/config/.mocharc.js | 1 + example/config/.mocharc.yml | 1 + lib/cli/run-option-metadata.js | 1 + lib/cli/run.js | 4 ++ lib/mocha.js | 47 ++++++++++----- lib/runner.js | 7 ++- test/integration/options/failZero.spec.js | 22 +++++++ test/unit/mocha.spec.js | 70 ++++++++++++----------- 9 files changed, 117 insertions(+), 59 deletions(-) create mode 100644 test/integration/options/failZero.spec.js diff --git a/docs/index.md b/docs/index.md index b0c22608c6..7300faf9e9 100644 --- a/docs/index.md +++ b/docs/index.md @@ -876,7 +876,7 @@ Use this option to have Mocha check for global variables that are leaked while r ### `--dry-run` -> _New in v9.0.0._ Report tests without executing any of them, neither tests nor hooks. +> _New in v9.0.0_ Report tests without executing any of them, neither tests nor hooks. ### `--exit` @@ -899,6 +899,10 @@ To ensure your tests aren't leaving messes around, here are some ideas to get st - Try something like [wtfnode][npm-wtfnode] - Use [`.only`](#exclusive-tests) until you find the test that causes Mocha to hang +### `--fail-zero` + +> _New in v9.1.0_ Fail test run if no tests are encountered with `exit-code: 1`. + ### `--forbid-only` Enforce a rule that tests may not be exclusive (use of e.g., `describe.only()` or `it.only()` is disallowed). @@ -1007,7 +1011,7 @@ Can be specified as a comma-delimited list. ### `--config ` -> _New in v6.0.0._ +> _New in v6.0.0_ Specify an explicit path to a [configuration file](#configuring-mocha-nodejs). @@ -1015,7 +1019,7 @@ By default, Mocha will search for a config file if `--config` is not specified; ### `--node-option , -n ` -> _New in v9.1.0._ +> _New in v9.1.0_ For Node.js and V8 options. Mocha forwards these options to Node.js by spawning a new child-process.
The options are set without leading dashes `--`, e.g. `-n require=foo -n unhandled-rejections=strict` @@ -1028,7 +1032,7 @@ Can also be specified as a comma-delimited list: `-n require=foo,unhandled-rejec ### `--package ` -> _New in v6.0.0._ +> _New in v6.0.0_ Specify an explicit path to a [`package.json` file](#configuring-mocha-nodejs) (ostensibly containing configuration in a `mocha` property). @@ -1042,7 +1046,7 @@ Specifying `--extension` will _remove_ `.js` as a test file extension; use `--ex The option can be given multiple times. The option accepts a comma-delimited list: `--extension a,b` is equivalent to `--extension a --extension b`. -> _New in v8.2.0._ +> _New in v8.2.0_ `--extension` now supports multipart extensions (e.g., `spec.js`), leading dots (`.js`) and combinations thereof (`.spec.js`); @@ -1217,7 +1221,7 @@ These flags vary depending on your version of Node.js. `node` flags can be defined in Mocha's [configuration](#configuring-mocha-nodejs). -> _New in v9.1.0._ You can also pass `node` flags to Node.js using [`--node-option`](#-node-option-name-n-name). +> _New in v9.1.0_ You can also pass `node` flags to Node.js using [`--node-option`](#-node-option-name-n-name). ### `--enable-source-maps` @@ -1238,7 +1242,7 @@ Prepend `--v8-` to any flag listed in the output of `node --v8-options` (excludi V8 flags can be defined in Mocha's [configuration](#configuring-mocha-nodejs). -> _New in v9.1.0._ You can also pass V8 flags (without `--v8-`) to Node.js using [`--node-option`](#-node-option-name-n-name). +> _New in v9.1.0_ You can also pass V8 flags (without `--v8-`) to Node.js using [`--node-option`](#-node-option-name-n-name). ## Parallel Tests @@ -1369,7 +1373,7 @@ It's unlikely (but not impossible) to see a performance gain from a [job count]( ## Root Hook Plugins -> _New in v8.0.0._ +> _New in v8.0.0_ In some cases, you may want a [hook](#hooks) before (or after) every test in every file. These are called _root hooks_. Previous to v8.0.0, the way to accomplish this was to use `--file` combined with root hooks (see [example above](#root-hooks-are-not-global)). This still works in v8.0.0, but _not_ when running tests in parallel mode! For that reason, running root hooks using this method is _strongly discouraged_, and may be deprecated in the future. @@ -1593,7 +1597,7 @@ If you're a library maintainer, and your library uses root hooks, you can migrat ## Global Fixtures -> New in v8.2.0 +> _New in v8.2.0_ At first glance, _global fixtures_ seem similar to [root hooks](#root-hook-plugins). However, unlike root hooks, global fixtures: @@ -2121,6 +2125,7 @@ mocha.setup({ bail: true, checkLeaks: true, dryRun: true, + failZero: true, forbidOnly: true, forbidPending: true, global: ['MyLib'], diff --git a/example/config/.mocharc.js b/example/config/.mocharc.js index 402ec03565..b730b4d399 100644 --- a/example/config/.mocharc.js +++ b/example/config/.mocharc.js @@ -15,6 +15,7 @@ module.exports = { diff: true, exit: false, // could be expressed as "'no-exit': true" extension: ['js', 'cjs', 'mjs'], + 'fail-zero': true, fgrep: 'something', // fgrep and grep are mutually exclusive file: ['/path/to/some/file', '/path/to/some/other/file'], 'forbid-only': false, diff --git a/example/config/.mocharc.yml b/example/config/.mocharc.yml index c1e13a5d35..456b351332 100644 --- a/example/config/.mocharc.yml +++ b/example/config/.mocharc.yml @@ -8,6 +8,7 @@ delay: false diff: true exit: false # could be expressed as "no-exit: true" extension: ['js', 'cjs', 'mjs'] +fail-zero: true # fgrep and grep are mutually exclusive fgrep: 'something' file: diff --git a/lib/cli/run-option-metadata.js b/lib/cli/run-option-metadata.js index 6bc6604018..984ad4b75e 100644 --- a/lib/cli/run-option-metadata.js +++ b/lib/cli/run-option-metadata.js @@ -35,6 +35,7 @@ const TYPES = (exports.types = { 'diff', 'dry-run', 'exit', + 'fail-zero', 'forbid-only', 'forbid-pending', 'full-trace', diff --git a/lib/cli/run.js b/lib/cli/run.js index 06941fab8c..4a4da6cf68 100644 --- a/lib/cli/run.js +++ b/lib/cli/run.js @@ -98,6 +98,10 @@ exports.builder = yargs => requiresArg: true, coerce: list }, + 'fail-zero': { + description: 'Fail test run if no test(s) encountered', + group: GROUPS.RULES + }, fgrep: { conflicts: 'grep', description: 'Only run tests containing this string', diff --git a/lib/mocha.js b/lib/mocha.js index b36210d60e..42876adccd 100644 --- a/lib/mocha.js +++ b/lib/mocha.js @@ -164,6 +164,7 @@ exports.run = function(...args) { * @param {boolean} [options.delay] - Delay root suite execution? * @param {boolean} [options.diff] - Show diff on failure? * @param {boolean} [options.dryRun] - Report tests without running them? + * @param {boolean} [options.failZero] - Fail test run if zero tests? * @param {string} [options.fgrep] - Test filter given string. * @param {boolean} [options.forbidOnly] - Tests marked `only` fail the suite? * @param {boolean} [options.forbidPending] - Pending tests fail the suite? @@ -223,6 +224,7 @@ function Mocha(options = {}) { 'delay', 'diff', 'dryRun', + 'failZero', 'forbidOnly', 'forbidPending', 'fullTrace', @@ -778,20 +780,6 @@ Mocha.prototype.diff = function(diff) { return this; }; -/** - * Enables or disables running tests in dry-run mode. - * - * @public - * @see [CLI option](../#-dry-run) - * @param {boolean} [dryRun=true] - Whether to activate dry-run mode. - * @return {Mocha} this - * @chainable - */ -Mocha.prototype.dryRun = function(dryRun) { - this.options.dryRun = dryRun !== false; - return this; -}; - /** * @summary * Sets timeout threshold value. @@ -918,6 +906,34 @@ Mocha.prototype.delay = function delay() { return this; }; +/** + * Enables or disables running tests in dry-run mode. + * + * @public + * @see [CLI option](../#-dry-run) + * @param {boolean} [dryRun=true] - Whether to activate dry-run mode. + * @return {Mocha} this + * @chainable + */ +Mocha.prototype.dryRun = function(dryRun) { + this.options.dryRun = dryRun !== false; + return this; +}; + +/** + * Fails test run if no tests encountered with exit-code 1. + * + * @public + * @see [CLI option](../#-fail-zero) + * @param {boolean} [failZero=true] - Whether to fail test run. + * @return {Mocha} this + * @chainable + */ +Mocha.prototype.failZero = function(failZero) { + this.options.failZero = failZero !== false; + return this; +}; + /** * Causes tests marked `only` to fail the suite. * @@ -1023,9 +1039,10 @@ Mocha.prototype.run = function(fn) { var options = this.options; options.files = this.files; const runner = new this._runnerClass(suite, { + cleanReferencesAfterRun: this._cleanReferencesAfterRun, delay: options.delay, dryRun: options.dryRun, - cleanReferencesAfterRun: this._cleanReferencesAfterRun + failZero: options.failZero }); createStatsCollector(runner); var reporter = new this._reporter(runner, options); diff --git a/lib/runner.js b/lib/runner.js index 079ab3066d..7f9184fc1a 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -135,10 +135,11 @@ class Runner extends EventEmitter { * @public * @class * @param {Suite} suite - Root suite - * @param {Object|boolean} [opts] - Options. If `boolean` (deprecated), whether or not to delay execution of root suite until ready. + * @param {Object|boolean} [opts] - Options. If `boolean` (deprecated), whether to delay execution of root suite until ready. + * @param {boolean} [opts.cleanReferencesAfterRun] - Whether to clean references to test fns and hooks when a suite is done. * @param {boolean} [opts.delay] - Whether to delay execution of root suite until ready. * @param {boolean} [opts.dryRun] - Whether to report tests without running them. - * @param {boolean} [opts.cleanReferencesAfterRun] - Whether to clean references to test fns and hooks when a suite is done. + * @param {boolean} [options.failZero] - Whether to fail test run if zero tests encountered. */ constructor(suite, opts) { super(); @@ -1044,6 +1045,8 @@ Runner.prototype.run = function(fn, opts = {}) { fn = fn || function() {}; const end = () => { + if (!this.total && this._opts.failZero) this.failures = 1; + debug('run(): root suite completed; emitting %s', constants.EVENT_RUN_END); this.emit(constants.EVENT_RUN_END); }; diff --git a/test/integration/options/failZero.spec.js b/test/integration/options/failZero.spec.js new file mode 100644 index 0000000000..02b88c40c2 --- /dev/null +++ b/test/integration/options/failZero.spec.js @@ -0,0 +1,22 @@ +'use strict'; + +var helpers = require('../helpers'); +var runMochaJSON = helpers.runMochaJSON; + +describe('--fail-zero', function() { + var args = ['--fail-zero', '--grep', 'yyyyyy']; + + it('should fail since no tests are encountered', function(done) { + var fixture = '__default__.fixture.js'; + runMochaJSON(fixture, args, function(err, res) { + if (err) { + return done(err); + } + + expect(res, 'to have passed test count', 0) + .and('to have test count', 0) + .and('to have exit code', 1); + done(); + }); + }); +}); diff --git a/test/unit/mocha.spec.js b/test/unit/mocha.spec.js index 35f7abd327..6255e2ad9f 100644 --- a/test/unit/mocha.spec.js +++ b/test/unit/mocha.spec.js @@ -265,22 +265,18 @@ describe('Mocha', function() { }); describe('bail()', function() { - describe('when provided no arguments', function() { - it('should set the "bail" flag on the root suite', function() { - mocha.bail(); - expect(suite.bail, 'to have a call satisfying', [true]).and( - 'was called once' - ); - }); + it('should set the "bail" flag on the root suite', function() { + mocha.bail(); + expect(suite.bail, 'to have a call satisfying', [true]).and( + 'was called once' + ); }); - describe('when provided a falsy argument', function() { - it('should unset the "bail" flag on the root suite', function() { - mocha.bail(false); - expect(suite.bail, 'to have a call satisfying', [false]).and( - 'was called once' - ); - }); + it('should unset the "bail" flag on the root suite', function() { + mocha.bail(false); + expect(suite.bail, 'to have a call satisfying', [false]).and( + 'was called once' + ); }); it('should be chainable', function() { @@ -344,25 +340,9 @@ describe('Mocha', function() { expect(mocha.options, 'to have property', 'diff', true); }); - describe('when provided `false` argument', function() { - it('should set the diff option to false', function() { - mocha.diff(false); - expect(mocha.options, 'to have property', 'diff', false); - }); - }); - }); - - describe('dryRun()', function() { - it('should set the dryRun option to true', function() { - mocha.dryRun(); - expect(mocha.options, 'to have property', 'dryRun', true); - }); - - describe('when provided `false` argument', function() { - it('should set the dryRun option to false', function() { - mocha.dryRun(false); - expect(mocha.options, 'to have property', 'dryRun', false); - }); + it('should set the diff option to false', function() { + mocha.diff(false); + expect(mocha.options, 'to have property', 'diff', false); }); }); @@ -385,6 +365,30 @@ describe('Mocha', function() { }); }); + describe('dryRun()', function() { + it('should set the dryRun option to true', function() { + mocha.dryRun(); + expect(mocha.options, 'to have property', 'dryRun', true); + }); + + it('should set the dryRun option to false', function() { + mocha.dryRun(false); + expect(mocha.options, 'to have property', 'dryRun', false); + }); + }); + + describe('failZero()', function() { + it('should set the failZero option to true', function() { + mocha.failZero(); + expect(mocha.options, 'to have property', 'failZero', true); + }); + + it('should set the failZero option to false', function() { + mocha.failZero(false); + expect(mocha.options, 'to have property', 'failZero', false); + }); + }); + describe('forbidOnly()', function() { it('should set the forbidOnly option to true', function() { mocha.forbidOnly(); From 171e211cd2938b3f87011fa8c717292cb08adbe7 Mon Sep 17 00:00:00 2001 From: Michal Dorner Date: Fri, 20 Aug 2021 07:03:29 +0200 Subject: [PATCH 08/10] feat(reporter): add output option to 'JSON' (#4607) Co-authored-by: Juerg B <44573692+juergba@users.noreply.github.com> --- docs/index.md | 2 + example/config/.mocharc.js | 2 +- example/config/.mocharc.yml | 2 +- lib/reporters/base.js | 2 +- lib/reporters/json.js | 31 +++- test/reporters/json.spec.js | 283 ++++++++++++++++++++++++------------ 6 files changed, 219 insertions(+), 103 deletions(-) diff --git a/docs/index.md b/docs/index.md index 7300faf9e9..94fbe29089 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1933,6 +1933,8 @@ Alias: `JSON`, `json` The JSON reporter outputs a single large JSON object when the tests have completed (failures or not). +By default, it will output to the console. To write directly to a file, use `--reporter-option output=filename.json`. + ![json reporter](images/reporter-json.png?withoutEnlargement&resize=920,9999){:class="screenshot" loading="lazy"} ### JSON Stream diff --git a/example/config/.mocharc.js b/example/config/.mocharc.js index b730b4d399..e40bea1b71 100644 --- a/example/config/.mocharc.js +++ b/example/config/.mocharc.js @@ -33,7 +33,7 @@ module.exports = { parallel: false, recursive: false, reporter: 'spec', - 'reporter-option': ['foo=bar', 'baz=quux'], + 'reporter-option': ['foo=bar', 'baz=quux'], // array, not object require: '@babel/register', retries: 1, slow: '75', diff --git a/example/config/.mocharc.yml b/example/config/.mocharc.yml index 456b351332..e132b7a99d 100644 --- a/example/config/.mocharc.yml +++ b/example/config/.mocharc.yml @@ -35,7 +35,7 @@ package: './package.json' parallel: false recursive: false reporter: 'spec' -reporter-option: +reporter-option: # array, not object - 'foo=bar' - 'baz=quux' require: '@babel/register' diff --git a/lib/reporters/base.js b/lib/reporters/base.js index 20d1ccec11..f2f2bc65fc 100644 --- a/lib/reporters/base.js +++ b/lib/reporters/base.js @@ -90,7 +90,7 @@ exports.colors = { exports.symbols = { ok: symbols.success, - err: symbols.err, + err: symbols.error, dot: '.', comma: ',', bang: '!' diff --git a/lib/reporters/json.js b/lib/reporters/json.js index a314cd3805..05e6269361 100644 --- a/lib/reporters/json.js +++ b/lib/reporters/json.js @@ -7,12 +7,16 @@ */ var Base = require('./base'); +var fs = require('fs'); +var path = require('path'); +const createUnsupportedError = require('../errors').createUnsupportedError; +const utils = require('../utils'); var constants = require('../runner').constants; var EVENT_TEST_PASS = constants.EVENT_TEST_PASS; +var EVENT_TEST_PENDING = constants.EVENT_TEST_PENDING; var EVENT_TEST_FAIL = constants.EVENT_TEST_FAIL; var EVENT_TEST_END = constants.EVENT_TEST_END; var EVENT_RUN_END = constants.EVENT_RUN_END; -var EVENT_TEST_PENDING = constants.EVENT_TEST_PENDING; /** * Expose `JSON`. @@ -30,7 +34,7 @@ exports = module.exports = JSONReporter; * @param {Runner} runner - Instance triggers reporter actions. * @param {Object} [options] - runner options */ -function JSONReporter(runner, options) { +function JSONReporter(runner, options = {}) { Base.call(this, runner, options); var self = this; @@ -38,6 +42,14 @@ function JSONReporter(runner, options) { var pending = []; var failures = []; var passes = []; + var output; + + if (options.reporterOption && options.reporterOption.output) { + if (utils.isBrowser()) { + throw createUnsupportedError('file output not supported in browser'); + } + output = options.reporterOption.output; + } runner.on(EVENT_TEST_END, function(test) { tests.push(test); @@ -66,7 +78,20 @@ function JSONReporter(runner, options) { runner.testResults = obj; - process.stdout.write(JSON.stringify(obj, null, 2)); + var json = JSON.stringify(obj, null, 2); + if (output) { + try { + fs.mkdirSync(path.dirname(output), {recursive: true}); + fs.writeFileSync(output, json); + } catch (err) { + console.error( + `${Base.symbols.err} [mocha] writing output to "${output}" failed: ${err.message}\n` + ); + process.stdout.write(json); + } + } else { + process.stdout.write(json); + } }); } diff --git a/test/reporters/json.spec.js b/test/reporters/json.spec.js index 3eca1e9175..8a44bc4e2a 100644 --- a/test/reporters/json.spec.js +++ b/test/reporters/json.spec.js @@ -1,12 +1,16 @@ 'use strict'; +var fs = require('fs'); var sinon = require('sinon'); +var JSONReporter = require('../../lib/reporters/json'); +var utils = require('../../lib/utils'); var Mocha = require('../../'); var Suite = Mocha.Suite; var Runner = Mocha.Runner; var Test = Mocha.Test; describe('JSON reporter', function() { + var mocha; var suite; var runner; var testTitle = 'json test 1'; @@ -14,131 +18,216 @@ describe('JSON reporter', function() { var noop = function() {}; beforeEach(function() { - var mocha = new Mocha({ + mocha = new Mocha({ reporter: 'json' }); suite = new Suite('JSON suite', 'root'); runner = new Runner(suite); - var options = {}; - /* eslint no-unused-vars: off */ - var mochaReporter = new mocha._reporter(runner, options); - }); - - beforeEach(function() { - sinon.stub(process.stdout, 'write').callsFake(noop); }); afterEach(function() { sinon.restore(); }); - it('should have 1 test failure', function(done) { - var error = {message: 'oh shit'}; + describe('test results', function() { + beforeEach(function() { + var options = {}; + /* eslint no-unused-vars: off */ + var mochaReporter = new mocha._reporter(runner, options); + }); + + beforeEach(function() { + sinon.stub(process.stdout, 'write').callsFake(noop); + }); + + it('should have 1 test failure', function(done) { + var error = {message: 'oh shit'}; - var test = new Test(testTitle, function(done) { - done(new Error(error.message)); + var test = new Test(testTitle, function(done) { + done(new Error(error.message)); + }); + + test.file = testFile; + suite.addTest(test); + + runner.run(function(failureCount) { + sinon.restore(); + expect(runner, 'to satisfy', { + testResults: { + failures: [ + { + title: testTitle, + file: testFile, + err: { + message: error.message + } + } + ] + } + }); + expect(failureCount, 'to be', 1); + done(); + }); }); - test.file = testFile; - suite.addTest(test); - - runner.run(function(failureCount) { - sinon.restore(); - expect(runner, 'to satisfy', { - testResults: { - failures: [ - { - title: testTitle, - file: testFile, - err: { - message: error.message + it('should have 1 test pending', function(done) { + var test = new Test(testTitle); + test.file = testFile; + suite.addTest(test); + + runner.run(function(failureCount) { + sinon.restore(); + expect(runner, 'to satisfy', { + testResults: { + pending: [ + { + title: testTitle, + file: testFile } - } - ] - } + ] + } + }); + expect(failureCount, 'to be', 0); + done(); }); - expect(failureCount, 'to be', 1); - done(); }); - }); - it('should have 1 test pending', function(done) { - var test = new Test(testTitle); - test.file = testFile; - suite.addTest(test); - - runner.run(function(failureCount) { - sinon.restore(); - expect(runner, 'to satisfy', { - testResults: { - pending: [ - { - title: testTitle, - file: testFile - } - ] - } + it('should have 1 test pass', function(done) { + const test = new Test(testTitle, () => {}); + + test.file = testFile; + suite.addTest(test); + + runner.run(function(failureCount) { + sinon.restore(); + expect(runner, 'to satisfy', { + testResults: { + passes: [ + { + title: testTitle, + file: testFile, + speed: /(slow|medium|fast)/ + } + ] + } + }); + expect(failureCount, 'to be', 0); + done(); }); - expect(failureCount, 'to be', 0); - done(); }); - }); - it('should have 1 test pass', function(done) { - const test = new Test(testTitle, () => {}); - - test.file = testFile; - suite.addTest(test); - - runner.run(function(failureCount) { - expect(runner, 'to satisfy', { - testResults: { - passes: [ - { - title: testTitle, - file: testFile, - speed: /(slow|medium|fast)/ - } - ] - } + it('should handle circular objects in errors', function(done) { + var testTitle = 'json test 1'; + function CircleError() { + this.message = 'oh shit'; + this.circular = this; + } + var error = new CircleError(); + + var test = new Test(testTitle, function(done) { + throw error; + }); + + test.file = testFile; + suite.addTest(test); + + runner.run(function(failureCount) { + sinon.restore(); + expect(runner, 'to satisfy', { + testResults: { + failures: [ + { + title: testTitle, + file: testFile, + err: { + message: error.message + } + } + ] + } + }); + expect(failureCount, 'to be', 1); + done(); }); - expect(failureCount, 'to be', 0); - done(); }); }); - it('should handle circular objects in errors', function(done) { - var testTitle = 'json test 1'; - function CircleError() { - this.message = 'oh shit'; - this.circular = this; - } - var error = new CircleError(); + describe('when "reporterOption.output" is provided', function() { + var expectedDirName = 'reports'; + var expectedFileName = 'reports/test-results.json'; + var options = { + reporterOption: { + output: expectedFileName + } + }; + + beforeEach(function() { + /* eslint no-unused-vars: off */ + var mochaReporter = new mocha._reporter(runner, options); + }); - var test = new Test(testTitle, function(done) { - throw error; + beforeEach(function() { + // Add one test to suite to avoid assertions against empty test results + var test = new Test(testTitle, () => {}); + test.file = testFile; + suite.addTest(test); }); - test.file = testFile; - suite.addTest(test); - - runner.run(function(failureCount) { - sinon.restore(); - expect(runner, 'to satisfy', { - testResults: { - failures: [ - { - title: testTitle, - file: testFile, - err: { - message: error.message - } - } - ] - } + it('should write test results to file', function(done) { + const fsMkdirSync = sinon.stub(fs, 'mkdirSync'); + const fsWriteFileSync = sinon.stub(fs, 'writeFileSync'); + + fsWriteFileSync.callsFake(function(filename, content) { + const expectedJson = JSON.stringify(runner.testResults, null, 2); + expect(expectedFileName, 'to be', filename); + expect(content, 'to be', expectedJson); }); - expect(failureCount, 'to be', 1); - done(); + + runner.run(function() { + expect( + fsMkdirSync.calledWith(expectedDirName, {recursive: true}), + 'to be true' + ); + expect(fsWriteFileSync.calledOnce, 'to be true'); + done(); + }); + }); + + it('should warn and write test results to console', function(done) { + const fsMkdirSync = sinon.stub(fs, 'mkdirSync'); + const fsWriteFileSync = sinon.stub(fs, 'writeFileSync'); + + fsWriteFileSync.throws('unable to write file'); + + const outLog = []; + const fake = chunk => outLog.push(chunk); + sinon.stub(process.stderr, 'write').callsFake(fake); + sinon.stub(process.stdout, 'write').callsFake(fake); + + runner.run(function() { + sinon.restore(); + expect( + fsMkdirSync.calledWith(expectedDirName, {recursive: true}), + 'to be true' + ); + expect(fsWriteFileSync.calledOnce, 'to be true'); + expect( + outLog[0], + 'to contain', + `[mocha] writing output to "${expectedFileName}" failed:` + ); + expect(outLog[1], 'to match', /"fullTitle": "JSON suite json test 1"/); + done(); + }); + }); + + it('should throw "unsupported error" in browser', function() { + sinon.stub(utils, 'isBrowser').callsFake(() => true); + expect( + () => new JSONReporter(runner, options), + 'to throw', + 'file output not supported in browser' + ); }); }); }); From 3a14b28bdfd785828ec862fe9fa8d19a651fd63c Mon Sep 17 00:00:00 2001 From: Juerg B <44573692+juergba@users.noreply.github.com> Date: Fri, 20 Aug 2021 08:53:50 +0200 Subject: [PATCH 09/10] build(v9.1.0): update CHANGELOG [ci skip] --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b72d6a105..7ab4d4f1cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# 9.1.0 / 2021-08-20 + +## :tada: Enhancements + +- #4716: Add new option `--fail-zero` (@juergba) +- #4691: Add new option `--node-option` (@juergba) +- #4607: Add output option to `JSON` reporter (@dorny) + # 9.0.3 / 2021-07-25 ## :bug: Fixes From 014e47a8b07809e73b1598c7abeafe7a3b57a8f7 Mon Sep 17 00:00:00 2001 From: Juerg B <44573692+juergba@users.noreply.github.com> Date: Fri, 20 Aug 2021 09:08:25 +0200 Subject: [PATCH 10/10] build(v9.1.0): release --- AUTHORS | 1 + CHANGELOG.md | 6 +++--- package-lock.json | 2 +- package.json | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/AUTHORS b/AUTHORS index 3ddec65ce9..51a11e2e61 100644 --- a/AUTHORS +++ b/AUTHORS @@ -526,5 +526,6 @@ MoonSupport Dayzen Alexander Fenster kirill-golovan <57108967+kirill-golovan@users.noreply.github.com> +Michal Dorner # Generated by scripts/update-authors.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ab4d4f1cd..13d2a63e6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,9 @@ ## :tada: Enhancements -- #4716: Add new option `--fail-zero` (@juergba) -- #4691: Add new option `--node-option` (@juergba) -- #4607: Add output option to `JSON` reporter (@dorny) +- [#4716](https://github.com/mochajs/mocha/issues/4716): Add new option `--fail-zero` ([**@juergba**](https://github.com/juergba)) +- [#4691](https://github.com/mochajs/mocha/issues/4691): Add new option `--node-option` ([**@juergba**](https://github.com/juergba)) +- [#4607](https://github.com/mochajs/mocha/issues/4607): Add output option to `JSON` reporter ([**@dorny**](https://github.com/dorny)) # 9.0.3 / 2021-07-25 diff --git a/package-lock.json b/package-lock.json index cc8c1a437d..25f091780d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "mocha", - "version": "9.0.3", + "version": "9.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d1b201b421..83386125e2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mocha", - "version": "9.0.3", + "version": "9.1.0", "description": "simple, flexible, fun test framework", "keywords": [ "mocha",