From 6df12846e83c2d9adbc1b5cec3e52c1d6aab2066 Mon Sep 17 00:00:00 2001 From: Sona Lee Date: Wed, 7 Aug 2019 15:27:31 +0900 Subject: [PATCH 001/396] Drop node.js v6 support (#3885) --- .github/CONTRIBUTING.md | 100 ++++++++++++------------- .travis.yml | 3 - appveyor.yml | 1 - docs/README.md | 2 +- docs/index.md | 2 +- package.json | 2 +- test/integration/options/debug.spec.js | 50 ------------- 7 files changed, 53 insertions(+), 107 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 440a3cc92d..027a7f9647 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -8,90 +8,90 @@ If you have a question about using Mocha, please use the [mailing list](https:// ## :bug: I Found a Bug -Sorry! It happens to the best of us. If you've found a bug in Mocha, **please [search](https://github.com/mochajs/mocha/issues/) to see if it's already been reported**. Otherwise, create a [new issue](https://github.com/mochajs/mocha/issues/new). If you can fix the bug yourself, feel free to create a [pull request](#propose-a-change) thereafter. +Sorry! It happens to the best of us. If you've found a bug in Mocha, **please [search](https://github.com/mochajs/mocha/issues/) to see if it's already been reported**. Otherwise, create a [new issue](https://github.com/mochajs/mocha/issues/new). If you can fix the bug yourself, feel free to create a [pull request](#propose-a-change) thereafter. -Please include *as much detail as possible* to help us reproduce and diagnose the bug. Most importantly: +Please include _as much detail as possible_ to help us reproduce and diagnose the bug. Most importantly: -- Let us know *how* you're running Mocha (options, flags, environment, browser or Node.js, etc.) -- Include your test code or file(s). If large, please provide a link to a repository or [gist](https://gist.github.com). +- Let us know _how_ you're running Mocha (options, flags, environment, browser or Node.js, etc.) +- Include your test code or file(s). If large, please provide a link to a repository or [gist](https://gist.github.com). - Please show code in JavaScript only (any version) -If we need more information from you, we'll let you know. If you don't within a reasonable time frame (TBD), your issue will be automatically closed for inactivity. +If we need more information from you, we'll let you know. If you don't within a reasonable time frame (TBD), your issue will be automatically closed for inactivity. ## :exclamation: Propose a Change -Before you get your hands dirty, please [search](https://github.com/mochajs/mocha/issues/) for a related issue, or [create a new one](https://github.com/mochajs/mocha/issues/new). If you wish to contribute a new feature, this is doubly important! Let's discuss your proposed changes first; we don't want you to waste time implementing a change that is at odds with the project's direction. That said, we'll happily consider any contribution, no matter how great or small. +Before you get your hands dirty, please [search](https://github.com/mochajs/mocha/issues/) for a related issue, or [create a new one](https://github.com/mochajs/mocha/issues/new). If you wish to contribute a new feature, this is doubly important! Let's discuss your proposed changes first; we don't want you to waste time implementing a change that is at odds with the project's direction. That said, we'll happily consider any contribution, no matter how great or small. -*This paragraph would contain information about Mocha's roadmap, but it doesn't yet exist.* :poop: +_This paragraph would contain information about Mocha's roadmap, but it doesn't yet exist._ :poop: It's also important to understand some overarching goals of Mocha, detailed below. ### :soccer: About Project Goals -Mocha is a test framework. Developers use it against anything from legacy spaghetti in IE11 to stage-0 TC39 features in Electron. Mocha is committed to providing support for maintained (LTS) versions of Node.js and popular browsers (of which IE11 is still one, as of December 2018). +Mocha is a test framework. Developers use it against anything from legacy spaghetti in IE11 to stage-0 TC39 features in Electron. Mocha is committed to providing support for maintained (LTS) versions of Node.js and popular browsers (of which IE11 is still one, as of December 2018). -Mocha adheres strictly to [semantic versioning](https://semver.org). We are *extremely cautious* with changes that have the potential to break; given the size of Mocha's user base, it's *highly unlikely* a breaking change will slide by. +Mocha adheres strictly to [semantic versioning](https://semver.org). We are _extremely cautious_ with changes that have the potential to break; given the size of Mocha's user base, it's _highly unlikely_ a breaking change will slide by. -Mocha's usage far outweighs its resources. If a proposed feature would incur a maintenance penalty, it could be a hard sell. +Mocha's usage far outweighs its resources. If a proposed feature would incur a maintenance penalty, it could be a hard sell. We ask you please keep these goals in mind when making or proposing changes. ### :shoe: Contributing Code: Step-by-Step -Follow these steps to get going. If you are having trouble, don't be afraid to [ask for help](#got-a-question). +Follow these steps to get going. If you are having trouble, don't be afraid to [ask for help](#got-a-question). > PRO TIP: After `npm install`, run `npm start` to see a list of commands which can be run with `npm start ` (powered by [nps](https://npm.im/nps)). -1. [Install Node.js 6.x or newer](https://nodejs.org/en/download/). - - If you're new to installing Node, a tool like [nvm](https://github.com/creationix/nvm#install-script) can help you manage multiple version installations. - - You will need [Google Chrome](https://www.google.com/chrome/) to run browser-based tests locally. +1. [Install Node.js 8.x or newer](https://nodejs.org/en/download/). + - If you're new to installing Node, a tool like [nvm](https://github.com/creationix/nvm#install-script) can help you manage multiple version installations. + - You will need [Google Chrome](https://www.google.com/chrome/) to run browser-based tests locally. 1. Follow [Github's documentation](https://help.github.com/articles/fork-a-repo/) on setting up Git, forking and cloning. -1. Create a new branch in your working copy. Give your branch a descriptive name, such as `issue/12345`: `git checkout -b issue/12345`. +1. Create a new branch in your working copy. Give your branch a descriptive name, such as `issue/12345`: `git checkout -b issue/12345`. 1. Execute `npm install` to install the development dependencies. - - Do not use `yarn install`. - - Some optional dependencies may fail; you can safely ignore these unless you are trying to build the documentation. - - If you're sick of seeing the failures, run `npm install --ignore-scripts`. + - Do not use `yarn install`. + - Some optional dependencies may fail; you can safely ignore these unless you are trying to build the documentation. + - If you're sick of seeing the failures, run `npm install --ignore-scripts`. 1. Make your changes and add them via `git add`. - - Your changes will likely be somewhere in `lib/`, `bin/` or `browser-entry.js` (if your changes are browser-specific). - - Unit and/or integration **tests are required** for any code change. These live in `test/`. - - **Do not modify** the root `mocha.js` file directly; it is automatically generated. - - Keep your PR focused. Don't fix two things at once; don't upgrade dependencies unless necessary. + - Your changes will likely be somewhere in `lib/`, `bin/` or `browser-entry.js` (if your changes are browser-specific). + - Unit and/or integration **tests are required** for any code change. These live in `test/`. + - **Do not modify** the root `mocha.js` file directly; it is automatically generated. + - Keep your PR focused. Don't fix two things at once; don't upgrade dependencies unless necessary. 1. Before committing, run `npm start test`. - - This will run both Node.js-based and browser-based tests. - - Ultimately, your pull request will be built on our continuous integration servers ([Travis CI](https://travis-ci.org/mochajs/mocha) and [AppVeyor](https://ci.appveyor.com/project/boneskull/mocha)). The first step to ensuring these checks pass is to test on your own machine. - - A coverage check will be sent to [Coveralls](https://coveralls.io/github/mochajs/mocha). **A drop in code coverage % is considered a failed check**. + - This will run both Node.js-based and browser-based tests. + - Ultimately, your pull request will be built on our continuous integration servers ([Travis CI](https://travis-ci.org/mochajs/mocha) and [AppVeyor](https://ci.appveyor.com/project/boneskull/mocha)). The first step to ensuring these checks pass is to test on your own machine. + - A coverage check will be sent to [Coveralls](https://coveralls.io/github/mochajs/mocha). **A drop in code coverage % is considered a failed check**. 1. Commit your changes. - - Use a brief message on the first line, referencing a relevant issue (e.g. `closes #12345`). - - Add detail in subsequent lines. - - A pre-commit hook will run which automatically formats your staged changes (and fixes any problems it can) with ESLint and Prettier. If ESLint fails to fix an issue, your commit will fail and you will need to manually correct the problem. + - Use a brief message on the first line, referencing a relevant issue (e.g. `closes #12345`). + - Add detail in subsequent lines. + - A pre-commit hook will run which automatically formats your staged changes (and fixes any problems it can) with ESLint and Prettier. If ESLint fails to fix an issue, your commit will fail and you will need to manually correct the problem. 1. (Optional) Ensure you are up-to-date with Mocha's `master` branch: - - You can add an "upstream" remote repo using `git remote add upstream https://github.com/mochajs/mocha.git && git fetch upstream`. - - Navigate to your `master` branch using `git checkout master`. - - Pull changes from `upstream` using `git pull upstream master`. - - If any changes were pulled in, rebase your branch onto `master` by switching back to your branch (`git checkout `) then rebasing using `git rebase master`. + - You can add an "upstream" remote repo using `git remote add upstream https://github.com/mochajs/mocha.git && git fetch upstream`. + - Navigate to your `master` branch using `git checkout master`. + - Pull changes from `upstream` using `git pull upstream master`. + - If any changes were pulled in, rebase your branch onto `master` by switching back to your branch (`git checkout `) then rebasing using `git rebase master`. 1. Push your changes to your fork; `git push origin`. -1. In your browser, navigate to [mochajs/mocha](https://github.com/mochajs/mocha). You should see a notification about your recent changes in your fork's branch, with a (green?) button to create a pull request. Click it. -1. Describe your changes in detail here, following the template. Once you're satisfied, submit the form. -1. If you have not signed our [Contributor License Agreement](https://js.foundation/cla), a friendly robot will prompt you to do so. A [CLA](https://cla.js.foundation/mochajs/mocha) (electronic) signature is **required** for all contributions of code to Mocha. -1. Continuous integration checks will run against your changes. The result of these checks will be displayed on your PR. - - If the checks fail, you must address those before the PR is accepted. - - GitHub will indicate if there's a conflict. If this happens, you will need to [rebase](https://help.github.com/articles/about-git-rebase/) your branch onto the `master` branch of the source repository. **Do not `git merge`**. - - (Optional) [Squash](https://help.github.com/articles/about-pull-request-merges/#squash-and-merge-your-pull-request-commits) your changesets. If you have multiple changesets in your PR, they will be squashed upon PR acceptance by the Mocha team. +1. In your browser, navigate to [mochajs/mocha](https://github.com/mochajs/mocha). You should see a notification about your recent changes in your fork's branch, with a (green?) button to create a pull request. Click it. +1. Describe your changes in detail here, following the template. Once you're satisfied, submit the form. +1. If you have not signed our [Contributor License Agreement](https://js.foundation/cla), a friendly robot will prompt you to do so. A [CLA](https://cla.js.foundation/mochajs/mocha) (electronic) signature is **required** for all contributions of code to Mocha. +1. Continuous integration checks will run against your changes. The result of these checks will be displayed on your PR. + - If the checks fail, you must address those before the PR is accepted. + - GitHub will indicate if there's a conflict. If this happens, you will need to [rebase](https://help.github.com/articles/about-git-rebase/) your branch onto the `master` branch of the source repository. **Do not `git merge`**. + - (Optional) [Squash](https://help.github.com/articles/about-pull-request-merges/#squash-and-merge-your-pull-request-commits) your changesets. If you have multiple changesets in your PR, they will be squashed upon PR acceptance by the Mocha team. 1. Be patient while your PR is reviewed. This can take a while. We may request changes, but don't be afraid to question them. -1. Your PR might become conflicted with the code in `master`. If this is the case, you will need to [update your PR](#up-to-date) and resolve your conflicts. -1. You don't need to make a new PR to any needed changes. Instead, commit on top of your changes, and push these to your fork's branch. The PR will be updated, and CI will re-run. +1. Your PR might become conflicted with the code in `master`. If this is the case, you will need to [update your PR](#up-to-date) and resolve your conflicts. +1. You don't need to make a new PR to any needed changes. Instead, commit on top of your changes, and push these to your fork's branch. The PR will be updated, and CI will re-run. Join us in the [contributors' chat](https://gitter.im/mochajs/contributors)! ## :angel: I Just Want To Help -*Excellent.* Here's how: +_Excellent._ Here's how: -- **Handy with JavaScript?** Please check out the issues labeled [`help wanted`](https://github.com/mochajs/mocha/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) or [`good-first-issue`](https://github.com/mochajs/mocha/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Agood-first-issue). Try `npx good-first-issue mocha`! -- **Can you write ~~good~~ well?** The [documentation](https://mochajs.org) almost always needs some love. See the [doc-related issues](https://github.com/mochajs/mocha/issues?q=is%3Aopen+is%3Aissue+label%3Adocumentation). -- **Design your thing?** [Our site](https://mochajs.org) needs your magic touch. -- **Familiar with Mocha's codebase?** We could use your help triaging issues and/or reviewing pull requests. Please contact an [org member](https://github.com/orgs/mochajs/people), and we'll chat. -- **Want to build our community?** Mocha has a *lot* of users. We could use your help bringing everyone together in peace and harmony. Please contact an [org member](https://github.com/mochajs/people). -- **You can sell dirt to worms?** Let's raise Mocha's profile in the JavaScript and OSS communities. Please contact an [org member](https://github.com/orgs/mochajs/people)! -- **Wait--you write unit tests for *fun*?** A PR which increases coverage is unlikely to be turned down. -- **Are you experienced?** :guitar: If you're a seasoned Mocha user, why not help answer some questions in the [main chat room](https://gitter.im/mochajs/mocha)? +- **Handy with JavaScript?** Please check out the issues labeled [`help wanted`](https://github.com/mochajs/mocha/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) or [`good-first-issue`](https://github.com/mochajs/mocha/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Agood-first-issue). Try `npx good-first-issue mocha`! +- **Can you write ~~good~~ well?** The [documentation](https://mochajs.org) almost always needs some love. See the [doc-related issues](https://github.com/mochajs/mocha/issues?q=is%3Aopen+is%3Aissue+label%3Adocumentation). +- **Design your thing?** [Our site](https://mochajs.org) needs your magic touch. +- **Familiar with Mocha's codebase?** We could use your help triaging issues and/or reviewing pull requests. Please contact an [org member](https://github.com/orgs/mochajs/people), and we'll chat. +- **Want to build our community?** Mocha has a _lot_ of users. We could use your help bringing everyone together in peace and harmony. Please contact an [org member](https://github.com/mochajs/people). +- **You can sell dirt to worms?** Let's raise Mocha's profile in the JavaScript and OSS communities. Please contact an [org member](https://github.com/orgs/mochajs/people)! +- **Wait--you write unit tests for _fun_?** A PR which increases coverage is unlikely to be turned down. +- **Are you experienced?** :guitar: If you're a seasoned Mocha user, why not help answer some questions in the [main chat room](https://gitter.im/mochajs/mocha)? diff --git a/.travis.yml b/.travis.yml index e6125d7d3c..e298c419a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,9 +46,6 @@ jobs: - <<: *node node_js: '8' - - <<: *node - node_js: '6' - - script: npm start test.bundle test.browser # XXX: update when canvas supplies a prebuilt binary for Node.js v12.x node_js: 10 diff --git a/appveyor.yml b/appveyor.yml index 780466f46b..4feecb1635 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,7 +15,6 @@ environment: - nodejs_version: '12' - nodejs_version: '10' - nodejs_version: '8' - - nodejs_version: '6' matrix: fast_finish: true install: diff --git a/docs/README.md b/docs/README.md index df132f76b0..203fa2e091 100644 --- a/docs/README.md +++ b/docs/README.md @@ -6,7 +6,7 @@ _So you wanna build the site?_ ## Prerequisites -- Node.js v6.x or greater +- Node.js v8.x or greater ## Development diff --git a/docs/index.md b/docs/index.md index 30613b87bf..8bb36e26ae 100644 --- a/docs/index.md +++ b/docs/index.md @@ -98,7 +98,7 @@ or as a development dependency for your project: $ npm install --save-dev mocha ``` -> As of v6.0.0, Mocha requires Node.js v6.0.0 or newer. +> As of v7.0.0, Mocha requires Node.js v8.0.0 or newer. ## Getting Started diff --git a/package.json b/package.json index b33729afaa..1621dda61e 100644 --- a/package.json +++ b/package.json @@ -503,7 +503,7 @@ "test": "./test" }, "engines": { - "node": ">= 6.0.0" + "node": ">= 8.0.0" }, "scripts": { "prepublishOnly": "nps test clean build", diff --git a/test/integration/options/debug.spec.js b/test/integration/options/debug.spec.js index e7518283c4..297aee91f6 100644 --- a/test/integration/options/debug.spec.js +++ b/test/integration/options/debug.spec.js @@ -77,54 +77,4 @@ describe('--debug', function() { ); }); }); - - describe('Node.js v6', function() { - // note that v6.3.0 and newer supports --inspect but still supports --debug. - before(function() { - if (process.version.substring(0, 2) !== 'v6') { - this.skip(); - } - }); - - it('should start debugger', function(done) { - var proc = invokeMocha( - ['--debug', DEFAULT_FIXTURE], - function(err, res) { - if (err) { - return done(err); - } - expect(res, 'to contain output', /Debugger listening/i); - done(); - }, - 'pipe' - ); - - // debugger must be manually killed - setTimeout(function() { - process.kill(proc.pid, 'SIGINT'); - }, 2000); - }); - - it('should respect custom host/port', function(done) { - var proc = invokeMocha( - ['--debug=127.0.0.1:9229', DEFAULT_FIXTURE], - function(err, res) { - if (err) { - return done(err); - } - expect( - res, - 'to contain output', - /Debugger listening on .*127.0.0.1:9229/i - ); - done(); - }, - 'pipe' - ); - - setTimeout(function() { - process.kill(proc.pid, 'SIGINT'); - }, 2000); - }); - }); }); From 9d3c58421ff86e6b468cddfa2a5c19b86233b999 Mon Sep 17 00:00:00 2001 From: Park Seong-beom Date: Wed, 7 Aug 2019 17:02:44 +0900 Subject: [PATCH 002/396] Add prefix `list-` to --interfaces and --reporters options (#3962) --- docs/index.md | 4 ++-- lib/cli/one-and-dones.js | 4 ++-- lib/cli/run-option-metadata.js | 4 ++-- lib/cli/run.js | 16 ++++++++-------- ...interfaces.spec.js => listInterfaces.spec.js} | 4 ++-- .../{reporters.spec.js => listReporters.spec.js} | 4 ++-- 6 files changed, 18 insertions(+), 18 deletions(-) rename test/integration/options/{interfaces.spec.js => listInterfaces.spec.js} (89%) rename test/integration/options/{reporters.spec.js => listReporters.spec.js} (90%) diff --git a/docs/index.md b/docs/index.md index 8bb36e26ae..3e00e3468e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -892,8 +892,8 @@ Positional Arguments Other Options --help, -h Show usage information & exit [boolean] --version, -V Show version number & exit [boolean] - --interfaces List built-in user interfaces & exit [boolean] - --reporters List built-in reporters & exit [boolean] + --list-interfaces List built-in user interfaces & exit [boolean] + --list-reporters List built-in reporters & exit [boolean] Mocha Resources Chat: https://gitter.im/mochajs/mocha diff --git a/lib/cli/one-and-dones.js b/lib/cli/one-and-dones.js index c981b4bbb1..56fc1af032 100644 --- a/lib/cli/one-and-dones.js +++ b/lib/cli/one-and-dones.js @@ -48,14 +48,14 @@ exports.ONE_AND_DONES = { * Dump list of built-in interfaces * @private */ - interfaces: () => { + 'list-interfaces': () => { showKeys(Mocha.interfaces); }, /** * Dump list of built-in reporters * @private */ - reporters: () => { + 'list-reporters': () => { showKeys(Mocha.reporters); } }; diff --git a/lib/cli/run-option-metadata.js b/lib/cli/run-option-metadata.js index fbc4ea9072..d146ceeca9 100644 --- a/lib/cli/run-option-metadata.js +++ b/lib/cli/run-option-metadata.js @@ -36,11 +36,11 @@ exports.types = { 'full-trace', 'growl', 'inline-diffs', - 'interfaces', 'invert', + 'list-interfaces', + 'list-reporters', 'no-colors', 'recursive', - 'reporters', 'sort', 'watch' ], diff --git a/lib/cli/run.js b/lib/cli/run.js index bb7c021998..dc94c101a4 100644 --- a/lib/cli/run.js +++ b/lib/cli/run.js @@ -147,14 +147,18 @@ exports.builder = yargs => 'Display actual/expected differences inline within each string', group: GROUPS.OUTPUT }, - interfaces: { - conflicts: Array.from(ONE_AND_DONE_ARGS), - description: 'List built-in user interfaces & exit' - }, invert: { description: 'Inverts --grep and --fgrep matches', group: GROUPS.FILTERS }, + 'list-interfaces': { + conflicts: Array.from(ONE_AND_DONE_ARGS), + description: 'List built-in user interfaces & exit' + }, + 'list-reporters': { + conflicts: Array.from(ONE_AND_DONE_ARGS), + description: 'List built-in reporters & exit' + }, 'no-colors': { description: 'Force-disable color output', group: GROUPS.OUTPUT, @@ -183,10 +187,6 @@ exports.builder = yargs => group: GROUPS.OUTPUT, requiresArg: true }, - reporters: { - conflicts: Array.from(ONE_AND_DONE_ARGS), - description: 'List built-in reporters & exit' - }, 'reporter-option': { coerce: opts => list(opts).reduce((acc, opt) => { diff --git a/test/integration/options/interfaces.spec.js b/test/integration/options/listInterfaces.spec.js similarity index 89% rename from test/integration/options/interfaces.spec.js rename to test/integration/options/listInterfaces.spec.js index 7c58b89d6f..a9c18a1172 100644 --- a/test/integration/options/interfaces.spec.js +++ b/test/integration/options/listInterfaces.spec.js @@ -5,7 +5,7 @@ var invokeMocha = helpers.invokeMocha; var escapeRegExp = helpers.escapeRegExp; var interfaces = require('../../../lib/mocha').interfaces; -describe('--interfaces', function() { +describe('--list-interfaces', function() { it('should dump a list of all interfaces with descriptions', function(done) { var expected = Object.keys(interfaces) .filter(function(name) { @@ -18,7 +18,7 @@ describe('--interfaces', function() { }; }); - invokeMocha(['--interfaces'], function(err, result) { + invokeMocha(['--list-interfaces'], function(err, result) { if (err) { return done(err); } diff --git a/test/integration/options/reporters.spec.js b/test/integration/options/listReporters.spec.js similarity index 90% rename from test/integration/options/reporters.spec.js rename to test/integration/options/listReporters.spec.js index 650c65edcd..6cf06e94f2 100644 --- a/test/integration/options/reporters.spec.js +++ b/test/integration/options/listReporters.spec.js @@ -5,7 +5,7 @@ var invokeMocha = helpers.invokeMocha; var escapeRegExp = helpers.escapeRegExp; var reporters = require('../../../lib/mocha').reporters; -describe('--reporters', function() { +describe('--list-reporters', function() { it('should dump a list of all reporters with descriptions', function(done) { var expected = Object.keys(reporters) .filter(function(name) { @@ -21,7 +21,7 @@ describe('--reporters', function() { }; }); - invokeMocha(['--reporters'], function(err, result) { + invokeMocha(['--list-reporters'], function(err, result) { if (err) { return done(err); } From 8e6e747837444aca4341ab6cc03688bc8a2a5c6d Mon Sep 17 00:00:00 2001 From: Juerg B <44573692+juergba@users.noreply.github.com> Date: Wed, 7 Aug 2019 13:05:59 +0200 Subject: [PATCH 003/396] Travis: don't run Smoke with Node v6 (#3981) --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index e298c419a4..5fb2bdb701 100644 --- a/.travis.yml +++ b/.travis.yml @@ -80,9 +80,6 @@ jobs: - <<: *smoke node_js: '8' - - <<: *smoke - node_js: '6' - - stage: precache script: true From 6d7c32abfe4c8c4dd76269964f28fe0a357c8977 Mon Sep 17 00:00:00 2001 From: Juerg B <44573692+juergba@users.noreply.github.com> Date: Sat, 10 Aug 2019 15:07:27 +0200 Subject: [PATCH 004/396] Update yargs-unparser to v1.6.0 (#3984) --- package-lock.json | 208 ++++++++++++++++++++++++++++------------------ package.json | 2 +- 2 files changed, 127 insertions(+), 83 deletions(-) diff --git a/package-lock.json b/package-lock.json index f7f44d0866..98f63a2678 100644 --- a/package-lock.json +++ b/package-lock.json @@ -817,7 +817,7 @@ }, "array-equal": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", "dev": true }, @@ -1288,7 +1288,7 @@ }, "autolinker": { "version": "0.15.3", - "resolved": "http://registry.npmjs.org/autolinker/-/autolinker-0.15.3.tgz", + "resolved": "https://registry.npmjs.org/autolinker/-/autolinker-0.15.3.tgz", "integrity": "sha1-NCQX2PLzRhsUzwkIjV7fh5HcmDI=", "dev": true }, @@ -1768,7 +1768,7 @@ }, "bl": { "version": "1.2.2", - "resolved": "http://registry.npmjs.org/bl/-/bl-1.2.2.tgz", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", "dev": true, "requires": { @@ -2319,7 +2319,7 @@ }, "browserify-aes": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, "requires": { @@ -2373,7 +2373,7 @@ }, "browserify-rsa": { "version": "4.0.1", - "resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", "dev": true, "requires": { @@ -2656,7 +2656,7 @@ }, "camelcase-keys": { "version": "2.1.0", - "resolved": "http://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", "dev": true, "requires": { @@ -2978,7 +2978,7 @@ }, "slice-ansi": { "version": "0.0.4", - "resolved": "http://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", "dev": true }, @@ -3154,7 +3154,7 @@ "dependencies": { "convert-source-map": { "version": "1.1.3", - "resolved": "http://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", "dev": true }, @@ -3470,7 +3470,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } @@ -3528,7 +3528,7 @@ }, "create-hash": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, "requires": { @@ -3541,7 +3541,7 @@ }, "create-hmac": { "version": "1.1.7", - "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, "requires": { @@ -3608,7 +3608,7 @@ }, "css-color-names": { "version": "0.0.4", - "resolved": "http://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", + "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", "integrity": "sha1-gIrcLnnPhHOAabZGyyDsJ762KeA=", "dev": true }, @@ -4232,7 +4232,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } @@ -4409,7 +4409,7 @@ }, "diffie-hellman": { "version": "5.0.3", - "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dev": true, "requires": { @@ -4579,7 +4579,7 @@ }, "duplexer": { "version": "0.1.1", - "resolved": "http://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", "dev": true }, @@ -4871,7 +4871,7 @@ }, "es6-promisify": { "version": "5.0.0", - "resolved": "http://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", "dev": true, "requires": { @@ -5138,7 +5138,7 @@ }, "doctrine": { "version": "1.5.0", - "resolved": "http://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", "dev": true, "requires": { @@ -6271,7 +6271,7 @@ }, "fs-access": { "version": "1.0.1", - "resolved": "http://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz", "integrity": "sha1-1qh/JiJxzv6+wwxVNAf7mV2od3o=", "dev": true, "requires": { @@ -6974,7 +6974,8 @@ "get-caller-file": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true }, "get-func-name": { "version": "2.0.0", @@ -7120,7 +7121,7 @@ }, "debug": { "version": "2.2.0", - "resolved": "http://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", "dev": true, "requires": { @@ -7129,7 +7130,7 @@ }, "ms": { "version": "0.7.1", - "resolved": "http://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", "dev": true } @@ -7531,7 +7532,7 @@ }, "htmlescape": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", "dev": true }, @@ -8246,7 +8247,7 @@ }, "is-obj": { "version": "1.0.1", - "resolved": "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", "dev": true }, @@ -9022,7 +9023,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } @@ -9641,7 +9642,8 @@ "lodash": { "version": "4.17.11", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true }, "lodash._reinterpolate": { "version": "3.0.0", @@ -9979,7 +9981,7 @@ }, "map-stream": { "version": "0.1.0", - "resolved": "http://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", + "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=", "dev": true }, @@ -10209,7 +10211,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } @@ -10244,7 +10246,7 @@ "dependencies": { "commander": { "version": "2.9.0", - "resolved": "http://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", "dev": true, "requires": { @@ -10355,7 +10357,7 @@ }, "media-typer": { "version": "0.3.0", - "resolved": "http://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", "dev": true }, @@ -10381,7 +10383,7 @@ "dependencies": { "lru-cache": { "version": "2.5.0", - "resolved": "http://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz", "integrity": "sha1-2COIrpyWC+y+oMc7uet5tsbOmus=", "dev": true } @@ -10416,7 +10418,7 @@ }, "meow": { "version": "3.7.0", - "resolved": "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", "dev": true, "requires": { @@ -10434,7 +10436,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } @@ -10540,7 +10542,7 @@ }, "minimist": { "version": "0.0.8", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" }, "minipass": { @@ -10599,7 +10601,7 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "requires": { "minimist": "0.0.8" @@ -11805,7 +11807,7 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, @@ -11827,7 +11829,7 @@ }, "os-tmpdir": { "version": "1.0.2", - "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, @@ -12120,7 +12122,7 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-is-inside": { @@ -12197,7 +12199,7 @@ }, "pause-stream": { "version": "0.0.11", - "resolved": "http://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", + "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", "dev": true, "requires": { @@ -12282,7 +12284,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, @@ -12326,7 +12328,7 @@ }, "pify": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true }, @@ -13046,7 +13048,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, @@ -13614,7 +13616,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } @@ -13682,7 +13684,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { @@ -14011,7 +14013,8 @@ "require-main-filename": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true }, "requirejs": { "version": "2.3.6", @@ -14251,7 +14254,7 @@ }, "safe-regex": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, "requires": { @@ -14362,7 +14365,7 @@ "dependencies": { "commander": { "version": "2.8.1", - "resolved": "http://registry.npmjs.org/commander/-/commander-2.8.1.tgz", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz", "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", "dev": true, "requires": { @@ -14635,7 +14638,7 @@ }, "sha.js": { "version": "2.4.11", - "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { @@ -14670,7 +14673,7 @@ }, "shasum": { "version": "1.0.2", - "resolved": "http://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", "integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=", "dev": true, "requires": { @@ -15293,7 +15296,7 @@ }, "split": { "version": "0.3.3", - "resolved": "http://registry.npmjs.org/split/-/split-0.3.3.tgz", + "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", "dev": true, "requires": { @@ -15398,7 +15401,7 @@ }, "starts-with": { "version": "1.0.2", - "resolved": "http://registry.npmjs.org/starts-with/-/starts-with-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/starts-with/-/starts-with-1.0.2.tgz", "integrity": "sha1-Fnk6cp2J1M89T7LtovkIrjV/GW8=", "dev": true }, @@ -15522,7 +15525,7 @@ }, "stream-combiner": { "version": "0.0.4", - "resolved": "http://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", + "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", "dev": true, "requires": { @@ -15732,7 +15735,7 @@ }, "strip-eof": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" }, "strip-indent": { @@ -15814,7 +15817,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } @@ -16038,7 +16041,7 @@ "dependencies": { "bluebird": { "version": "2.9.34", - "resolved": "http://registry.npmjs.org/bluebird/-/bluebird-2.9.34.tgz", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.9.34.tgz", "integrity": "sha1-L3tOyAIWMoqf3evfacjUlC/v99g=", "dev": true }, @@ -16305,7 +16308,7 @@ }, "through": { "version": "2.3.8", - "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, @@ -17717,43 +17720,84 @@ } }, "yargs-unparser": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.5.0.tgz", - "integrity": "sha512-HK25qidFTCVuj/D1VfNiEndpLIeJN78aqgR23nL3y4N0U/91cOAzqfHlF8n2BvoNDcZmJKin3ddNSvOxSr8flw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", + "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", "requires": { "flat": "^4.1.0", - "lodash": "^4.17.11", - "yargs": "^12.0.5" + "lodash": "^4.17.15", + "yargs": "^13.3.0" }, "dependencies": { + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, "yargs": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", + "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.2.0", + "cliui": "^5.0.0", "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", + "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", + "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^2.0.0", + "string-width": "^3.0.0", "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" - }, - "dependencies": { - "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } + "y18n": "^4.0.0", + "yargs-parser": "^13.1.1" + } + }, + "yargs-parser": { + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" } } } diff --git a/package.json b/package.json index 1621dda61e..62e70cd0b9 100644 --- a/package.json +++ b/package.json @@ -534,7 +534,7 @@ "wide-align": "1.1.3", "yargs": "13.2.2", "yargs-parser": "13.0.0", - "yargs-unparser": "1.5.0" + "yargs-unparser": "1.6.0" }, "devDependencies": { "@11ty/eleventy": "^0.8.3", From 7297b0ae37e545cec535fb4d41b31db0db26865f Mon Sep 17 00:00:00 2001 From: Juerg B <44573692+juergba@users.noreply.github.com> Date: Sun, 11 Aug 2019 09:31:33 +0200 Subject: [PATCH 005/396] Fix hook pattern of this.skip() in it() tests (#3859) --- lib/runner.js | 5 ---- .../pending/skip-async-spec.fixture.js | 20 +++++++++++++- .../pending/skip-sync-spec.fixture.js | 20 +++++++++++++- test/integration/pending.spec.js | 26 ++++++++++--------- 4 files changed, 52 insertions(+), 19 deletions(-) diff --git a/lib/runner.js b/lib/runner.js index 1b1d875a80..3ef0da1f4d 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -673,11 +673,6 @@ Runner.prototype.runTests = function(suite, fn) { self.fail(test, err); } self.emit(constants.EVENT_TEST_END, test); - - if (err instanceof Pending) { - return next(); - } - return self.hookUp(HOOK_TYPE_AFTER_EACH, next); } diff --git a/test/integration/fixtures/pending/skip-async-spec.fixture.js b/test/integration/fixtures/pending/skip-async-spec.fixture.js index 571ca5b851..402cd66c97 100644 --- a/test/integration/fixtures/pending/skip-async-spec.fixture.js +++ b/test/integration/fixtures/pending/skip-async-spec.fixture.js @@ -1,12 +1,30 @@ 'use strict'; +var assert = require('assert'); describe('skip in test', function () { + var runOrder = []; + beforeEach(function () { + runOrder.push('beforeEach'); + }); + it('should skip async', function (done) { var self = this; setTimeout(function () { self.skip(); // done() is not required }, 0); }); + it('should run other tests in suite', function () {}); - it('should run other tests in the suite', function () {}); + afterEach(function() { + runOrder.push('afterEach'); + }); + after(function() { + runOrder.push('after'); + assert.deepStrictEqual(runOrder, [ + 'beforeEach', 'afterEach', + 'beforeEach', 'afterEach', + 'after' + ]); + throw new Error('should throw this error'); + }); }); diff --git a/test/integration/fixtures/pending/skip-sync-spec.fixture.js b/test/integration/fixtures/pending/skip-sync-spec.fixture.js index 9178fce033..515c91d1ec 100644 --- a/test/integration/fixtures/pending/skip-sync-spec.fixture.js +++ b/test/integration/fixtures/pending/skip-sync-spec.fixture.js @@ -1,10 +1,28 @@ 'use strict'; +var assert = require('assert'); describe('skip in test', function () { + var runOrder = []; + beforeEach(function () { + runOrder.push('beforeEach'); + }); + it('should skip immediately', function () { this.skip(); throw new Error('never run this test'); }); + it('should run other tests in suite', function () {}); - it('should run other tests in the suite', function () {}); + afterEach(function() { + runOrder.push('afterEach'); + }); + after(function() { + runOrder.push('after'); + assert.deepStrictEqual(runOrder, [ + 'beforeEach', 'afterEach', + 'beforeEach', 'afterEach', + 'after' + ]); + throw new Error('should throw this error'); + }); }); diff --git a/test/integration/pending.spec.js b/test/integration/pending.spec.js index 7b96d36001..98620c8c9a 100644 --- a/test/integration/pending.spec.js +++ b/test/integration/pending.spec.js @@ -59,13 +59,14 @@ describe('pending', function() { it('should immediately skip the spec and run all others', function(done) { run('pending/skip-sync-spec.fixture.js', args, function(err, res) { if (err) { - done(err); - return; + return done(err); } - assert.strictEqual(res.stats.pending, 1); - assert.strictEqual(res.stats.passes, 1); - assert.strictEqual(res.stats.failures, 0); - assert.strictEqual(res.code, 0); + expect(res, 'to have failed with error', 'should throw this error') + .and('to have failed test count', 1) + .and('to have pending test count', 1) + .and('to have pending test order', 'should skip immediately') + .and('to have passed test count', 1) + .and('to have passed tests', 'should run other tests in suite'); done(); }); }); @@ -192,13 +193,14 @@ describe('pending', function() { it('should immediately skip the spec and run all others', function(done) { run('pending/skip-async-spec.fixture.js', args, function(err, res) { if (err) { - done(err); - return; + return done(err); } - assert.strictEqual(res.stats.pending, 1); - assert.strictEqual(res.stats.passes, 1); - assert.strictEqual(res.stats.failures, 0); - assert.strictEqual(res.code, 0); + expect(res, 'to have failed with error', 'should throw this error') + .and('to have failed test count', 1) + .and('to have pending test count', 1) + .and('to have pending test order', 'should skip async') + .and('to have passed test count', 1) + .and('to have passed tests', 'should run other tests in suite'); done(); }); }); From 5f1cad5ee254ab3ac48d4585726a884255a23583 Mon Sep 17 00:00:00 2001 From: Juerg B <44573692+juergba@users.noreply.github.com> Date: Tue, 13 Aug 2019 09:14:38 +0200 Subject: [PATCH 006/396] treat '--require esm' as Node option (#3983) --- bin/mocha | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bin/mocha b/bin/mocha index df7cf48ca3..865f5b1f07 100755 --- a/bin/mocha +++ b/bin/mocha @@ -117,6 +117,16 @@ if (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; + } + delete mochaArgs.r; +} + if (Object.keys(nodeArgs).length) { const {spawn} = require('child_process'); const mochaPath = require.resolve('../lib/cli/cli.js'); From fafa9b98809b941e8e6ea81868eabdc22cbd17af Mon Sep 17 00:00:00 2001 From: Juerg B <44573692+juergba@users.noreply.github.com> Date: Thu, 15 Aug 2019 09:30:29 +0200 Subject: [PATCH 007/396] Update yargs to v13.3.0 (#3986) Update yargs-parser to v13.1.1 --- package-lock.json | 116 +++++++++++++++++++++++++++++++--------------- package.json | 4 +- 2 files changed, 81 insertions(+), 39 deletions(-) diff --git a/package-lock.json b/package-lock.json index 98f63a2678..62eb962113 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3026,6 +3026,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, "requires": { "string-width": "^2.1.1", "strip-ansi": "^4.0.0", @@ -3036,6 +3037,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, "requires": { "ansi-regex": "^3.0.0" } @@ -3071,7 +3073,8 @@ "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true }, "coffee-script": { "version": "1.12.7", @@ -3573,6 +3576,7 @@ "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, "requires": { "nice-try": "^1.0.4", "path-key": "^2.0.1", @@ -4698,6 +4702,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, "requires": { "once": "^1.4.0" } @@ -5432,6 +5437,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, "requires": { "cross-spawn": "^6.0.0", "get-stream": "^4.0.0", @@ -7008,6 +7014,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, "requires": { "pump": "^3.0.0" } @@ -7964,7 +7971,8 @@ "invert-kv": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==" + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "dev": true }, "is-absolute": { "version": "1.0.0", @@ -8369,7 +8377,8 @@ "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true }, "is-svg": { "version": "3.0.0", @@ -9124,6 +9133,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "dev": true, "requires": { "invert-kv": "^2.0.0" } @@ -9963,6 +9973,7 @@ "version": "0.1.3", "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "dev": true, "requires": { "p-defer": "^1.0.0" } @@ -10365,6 +10376,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/mem/-/mem-4.1.0.tgz", "integrity": "sha512-I5u6Q1x7wxO0kdOpYBB28xueHADYps5uty/zg936CiG8NTe5sJL8EjrCuLneuDW3PlMdZBGDIn8BirEVdovZvg==", + "dev": true, "requires": { "map-age-cleaner": "^0.1.1", "mimic-fn": "^1.0.0", @@ -10512,7 +10524,8 @@ "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true }, "mimic-response": { "version": "1.0.1", @@ -10781,7 +10794,8 @@ "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true }, "nise": { "version": "1.5.0", @@ -11060,6 +11074,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, "requires": { "path-key": "^2.0.0" } @@ -11381,7 +11396,8 @@ "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true }, "nunjucks": { "version": "3.2.0", @@ -11815,6 +11831,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "dev": true, "requires": { "execa": "^1.0.0", "lcid": "^2.0.0", @@ -11861,7 +11878,8 @@ "p-defer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=" + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", + "dev": true }, "p-event": { "version": "1.3.0", @@ -11875,12 +11893,14 @@ "p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true }, "p-is-promise": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.0.0.tgz", - "integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==" + "integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==", + "dev": true }, "p-limit": { "version": "2.2.0", @@ -12134,7 +12154,8 @@ "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true }, "path-parse": { "version": "1.0.6", @@ -13454,6 +13475,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, "requires": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -14407,7 +14429,8 @@ "semver": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "dev": true }, "semver-compare": { "version": "1.0.0", @@ -14685,6 +14708,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, "requires": { "shebang-regex": "^1.0.0" } @@ -14692,7 +14716,8 @@ "shebang-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true }, "shell-quote": { "version": "1.6.1", @@ -14721,7 +14746,8 @@ "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true }, "simple-concat": { "version": "1.0.0", @@ -15736,7 +15762,8 @@ "strip-eof": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true }, "strip-indent": { "version": "1.0.1", @@ -17476,6 +17503,7 @@ "version": "2.1.0", "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, "requires": { "string-width": "^1.0.1", "strip-ansi": "^3.0.1" @@ -17484,12 +17512,14 @@ "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true }, "is-fullwidth-code-point": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, "requires": { "number-is-nan": "^1.0.0" } @@ -17498,6 +17528,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -17508,6 +17539,7 @@ "version": "3.0.1", "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, "requires": { "ansi-regex": "^2.0.0" } @@ -17662,27 +17694,36 @@ "dev": true }, "yargs": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz", - "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", + "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", "requires": { - "cliui": "^4.0.0", + "cliui": "^5.0.0", "find-up": "^3.0.0", "get-caller-file": "^2.0.1", - "os-locale": "^3.1.0", "require-directory": "^2.1.1", "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", "string-width": "^3.0.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^13.0.0" + "yargs-parser": "^13.1.1" }, "dependencies": { + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, "get-caller-file": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.1.tgz", - "integrity": "sha512-SpOZHfz845AH0wJYVuZk2jWDqFmu7Xubsx+ldIpwzy5pDUpu7OJHK7QYNSA2NPlDSKQwM1GFaAkciOWjjW92Sg==" + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, "require-main-filename": { "version": "2.0.0", @@ -17690,30 +17731,31 @@ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" }, "string-width": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.0.0.tgz", - "integrity": "sha512-rr8CUxBbvOZDUvc5lNIJ+OC1nPVpz+Siw9VBtUjB9b6jZehZLFt0JMCZzShFHIsI8cbhm0EsNIfWJMFV3cu3Ew==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "requires": { "emoji-regex": "^7.0.1", "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.0.0" + "strip-ansi": "^5.1.0" } }, - "yargs-parser": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", - "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" } } } }, "yargs-parser": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", - "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" diff --git a/package.json b/package.json index 62e70cd0b9..d33830d39a 100644 --- a/package.json +++ b/package.json @@ -532,8 +532,8 @@ "supports-color": "6.0.0", "which": "1.3.1", "wide-align": "1.1.3", - "yargs": "13.2.2", - "yargs-parser": "13.0.0", + "yargs": "13.3.0", + "yargs-parser": "13.1.1", "yargs-unparser": "1.6.0" }, "devDependencies": { From a3644c60b0482640e530837cf602feb06ee38c45 Mon Sep 17 00:00:00 2001 From: Juerg B <44573692+juergba@users.noreply.github.com> Date: Mon, 19 Aug 2019 08:26:59 +0200 Subject: [PATCH 008/396] Remove deprecated "getOptions()" and "lib/cli/options.js" (#3967) --- bin/options.js | 10 ---------- lib/cli/options.js | 35 ----------------------------------- package.json | 2 +- 3 files changed, 1 insertion(+), 46 deletions(-) delete mode 100644 bin/options.js diff --git a/bin/options.js b/bin/options.js deleted file mode 100644 index 102fd5a9c1..0000000000 --- a/bin/options.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -/* - * This module is deprecated and will be removed in a future version of Mocha. - * @deprecated Deprecated in v6.0.0; source moved into {@link module:lib/cli/options lib/cli/options module}. - * @module - * @exports module:lib/cli/options - */ - -module.exports = require('../lib/cli/options'); diff --git a/lib/cli/options.js b/lib/cli/options.js index a88dbfbf17..7cd2e48289 100644 --- a/lib/cli/options.js +++ b/lib/cli/options.js @@ -15,7 +15,6 @@ const mocharc = require('../mocharc.json'); const {list} = require('./run-helpers'); const {loadConfig, findConfig} = require('./config'); const findUp = require('find-up'); -const {deprecate} = require('../utils'); const debug = require('debug')('mocha:cli:options'); const {isNodeFlag} = require('./node-flags'); @@ -163,40 +162,6 @@ const parseMochaOpts = content => .filter(Boolean) .map(value => value.replace(/%20/g, ' ')); -/** - * Prepends options from run-control file to the command line arguments. - * - * @deprecated Deprecated in v6.0.0; This function is no longer used internally and will be removed in a future version. - * @public - * @alias module:lib/cli/options - * @see {@link https://mochajs.org/#mochaopts|mocha.opts} - */ -module.exports = function getOptions() { - deprecate( - 'getOptions() is DEPRECATED and will be removed from a future version of Mocha. Use loadOptions() instead' - ); - if (process.argv.length === 3 && ONE_AND_DONE_ARGS.has(process.argv[2])) { - return; - } - - const optsPath = - process.argv.indexOf('--opts') === -1 - ? mocharc.opts - : process.argv[process.argv.indexOf('--opts') + 1]; - - try { - const options = parseMochaOpts(fs.readFileSync(optsPath, 'utf8')); - - process.argv = process.argv - .slice(0, 2) - .concat(options.concat(process.argv.slice(2))); - } catch (ignore) { - // NOTE: should console.error() and throw the error - } - - process.env.LOADED_MOCHA_OPTS = true; -}; - /** * Given filepath in `args.opts`, attempt to load and parse a `mocha.opts` file. * @param {Object} [args] - Arguments object diff --git a/package.json b/package.json index d33830d39a..07b81c9c7d 100644 --- a/package.json +++ b/package.json @@ -596,7 +596,7 @@ "watchify": "^3.11.1" }, "files": [ - "bin/{*mocha,options.js}", + "bin/*mocha", "assets/growl/*.png", "lib/**/*.{js,html,json}", "index.js", From ea26c3dee16626f13ddb6f016a92875a8f30e34e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20M=C3=BCller?= Date: Thu, 22 Aug 2019 19:14:22 +0200 Subject: [PATCH 009/396] Add link checking to docs build step (#3972) * Add link checking to docs build step * Update hyperlink to 4.3.0 * Update @mocha/docdash to 2.1.2 * Fix internal broken fragment links from jsdoc comments to front page * Mark source code line fragment link checks as TODO. They are runtime JS generated and can't be found by hyperlink * Document reporters.Base.prototype.epilogue as a member of the right thing, thus not breaking docs links * Update to hyperlink 4.3.1 * Update to jsdoc 3.6.3 * experiment: add acorn 7 as dev dependency to attempt to fix broken build * Fix broken links from tutorial. Use jsdoc link functionality instead of guessign url's * Make hyperlink skipfilter argument windows compatible --- docs/api-tutorials/custom-reporter.md | 49 ++- lib/cli/options.js | 1 + lib/mocha.js | 32 +- lib/reporters/base.js | 2 +- package-lock.json | 484 +++++++++++++++++++++++--- package-scripts.js | 6 +- package.json | 6 +- 7 files changed, 477 insertions(+), 103 deletions(-) diff --git a/docs/api-tutorials/custom-reporter.md b/docs/api-tutorials/custom-reporter.md index a5abee8ce3..a0cfe48d66 100644 --- a/docs/api-tutorials/custom-reporter.md +++ b/docs/api-tutorials/custom-reporter.md @@ -77,44 +77,37 @@ For further examples, the built-in reporter implementations are the [best place ## The `Base` Reporter Class -[Base] is an "abstract" class. It contains console-specific settings and utilities, commonly used by built-in reporters. Browsing the built-in reporter implementations, you may often see static properties of [Base] referenced. +[Base]{@link Mocha.reporters.Base} is an "abstract" class. It contains console-specific settings and utilities, commonly used by built-in reporters. Browsing the built-in reporter implementations, you may often see static properties of [Base]{@link Mocha.reporters.Base} referenced. -It's often useful--but not necessary--for a custom reporter to extend [Base]. +It's often useful--but not necessary--for a custom reporter to extend [Base]{@link Mocha.reporters.Base}. ## Statistics -Mocha adds a `stats` property of type [StatsCollector](/api/module-lib_stats-collector.html) to the reporter's `Runner` instance (passed as first argument to constructor). +Mocha adds a `stats` property of type {@link StatsCollector} to the reporter's `Runner` instance (passed as first argument to constructor). ## Events -A reporter should listen for events emitted from the `runner` (a singleton instance of [Runner]). +A reporter should listen for events emitted from the `runner` (a singleton instance of {@link Runner}). The event names are exported from the `constants` property of `Mocha.Runner`: -| Constant | Event Name | Event Arguments | Description | -| -------------------- | ----------- | --------------- | ------------------------------------------------------------------------------------------- | -| `EVENT_RUN_BEGIN` | `start` | _(n/a)_ | Execution will begin. | -| `EVENT_RUN_END` | `end` | _(n/a)_ | All [Suite]s, [Test]s and [Hook]s have completed execution. | -| `EVENT_DELAY_BEGIN` | `waiting` | _(n/a)_ | Waiting for `global.run()` to be called; only emitted when [delay] option is `true`. | -| `EVENT_DELAY_END` | `ready` | _(n/a)_ | User called `global.run()` and the root suite is ready to execute. | -| `EVENT_SUITE_BEGIN` | `suite` | `Suite` | The [Hook]s and [Test]s within a [Suite] will be executed, including any nested [Suite]s. | -| `EVENT_SUITE_END` | `suite end` | `Suite` | The [Hook]s, [Test]s, and nested [Suite]s within a [Suite] have completed execution. | -| `EVENT_HOOK_BEGIN` | `hook` | `Hook` | A [Hook] will be executed. | -| `EVENT_HOOK_END` | `hook end` | `Hook` | A [Hook] has completed execution. | -| `EVENT_TEST_BEGIN` | `test` | `Test` | A [Test] will be executed. | -| `EVENT_TEST_END` | `test end` | `Test` | A [Test] has completed execution. | -| `EVENT_TEST_FAIL` | `fail` | `Test`, `Error` | A [Test] has failed or thrown an exception. | -| `EVENT_TEST_PASS` | `pass` | `Test` | A [Test] has passed. | -| `EVENT_TEST_PENDING` | `pending` | `Test` | A [Test] was skipped. | -| `EVENT_TEST_RETRY` | `retry` | `Test`, `Error` | A [Test] failed, but is about to be retried; only emitted if the `retry` option is nonzero. | +| Constant | Event Name | Event Arguments | Description | +| -------------------- | ----------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| `EVENT_RUN_BEGIN` | `start` | _(n/a)_ | Execution will begin. | +| `EVENT_RUN_END` | `end` | _(n/a)_ | All [Suites]{@link Suite}, [Tests]{@link Test} and [Hooks]{@link Hook} have completed execution. | +| `EVENT_DELAY_BEGIN` | `waiting` | _(n/a)_ | Waiting for `global.run()` to be called; only emitted when [delay](/#delayed-root-suite) option is `true`. | +| `EVENT_DELAY_END` | `ready` | _(n/a)_ | User called `global.run()` and the root suite is ready to execute. | +| `EVENT_SUITE_BEGIN` | `suite` | `Suite` | The [Hooks]{@link Hook} and [Tests]{@link Test} within a {@link Suite} will be executed, including any nested [Suites]{@link Suite}. | +| `EVENT_SUITE_END` | `suite end` | `Suite` | The [Hooks]{@link Hook}, [Tests]{@link Test}, and nested [Suites]{@link Suite} within a {@link Suite} have completed execution. | +| `EVENT_HOOK_BEGIN` | `hook` | `Hook` | A {@link Hook} will be executed. | +| `EVENT_HOOK_END` | `hook end` | `Hook` | A {@link Hook} has completed execution. | +| `EVENT_TEST_BEGIN` | `test` | `Test` | A {@link Test} will be executed. | +| `EVENT_TEST_END` | `test end` | `Test` | A {@link Test} has completed execution. | +| `EVENT_TEST_FAIL` | `fail` | `Test`, `Error` | A {@link Test} has failed or thrown an exception. | +| `EVENT_TEST_PASS` | `pass` | `Test` | A {@link Test} has passed. | +| `EVENT_TEST_PENDING` | `pending` | `Test` | A {@link Test} was skipped. | +| `EVENT_TEST_RETRY` | `retry` | `Test`, `Error` | A {@link Test} failed, but is about to be retried; only emitted if the `retry` option is nonzero. | **Please use these constants** instead of the event names in your own reporter! This will ensure compatibility with future versions of Mocha. -> It's important to understand that all `Suite` callbacks will be run _before_ the [Runner] emits `EVENT_RUN_BEGIN`. Hooks and tests, however, won't run until _after_ the [Runner] emits `EVENT_RUN_BEGIN`. - -[runner]: /api/runner.html -[test]: /api/test.html -[hook]: /api/hook.html -[suite]: /api/suite.html -[base]: /api/mocha.reporters.base.html -[delay]: /#delayed-root-suite.html +> It's important to understand that all `Suite` callbacks will be run _before_ the {@link Runner} emits `EVENT_RUN_BEGIN`. Hooks and tests, however, won't run until _after_ the {@link Runner} emits `EVENT_RUN_BEGIN`. diff --git a/lib/cli/options.js b/lib/cli/options.js index 7cd2e48289..ffbca06396 100644 --- a/lib/cli/options.js +++ b/lib/cli/options.js @@ -168,6 +168,7 @@ const parseMochaOpts = content => * @param {string|boolean} [args.opts] - Filepath to mocha.opts; defaults to whatever's in `mocharc.opts`, or `false` to skip * @returns {external:yargsParser.Arguments|void} If read, object containing parsed arguments * @memberof module:lib/cli/options + * @see {@link /#mochaopts|mocha.opts} * @public */ const loadMochaOpts = (args = {}) => { diff --git a/lib/mocha.js b/lib/mocha.js index c0a5aa6dd9..5582324b8a 100644 --- a/lib/mocha.js +++ b/lib/mocha.js @@ -163,7 +163,7 @@ function Mocha(options) { * Enables or disables bailing on the first failure. * * @public - * @see {@link https://mochajs.org/#-b---bail|CLI option} + * @see {@link /#-bail-b|CLI option} * @param {boolean} [bail=true] - Whether to bail on first error. * @returns {Mocha} this * @chainable @@ -184,7 +184,7 @@ Mocha.prototype.bail = function(bail) { * Useful for generic setup code that must be included within test suite. * * @public - * @see {@link https://mochajs.org/#--file-file|CLI option} + * @see {@link /#-file-filedirectoryglob|CLI option} * @param {string} file - Pathname of file to be loaded. * @returns {Mocha} this * @chainable @@ -198,8 +198,8 @@ Mocha.prototype.addFile = function(file) { * Sets reporter to `reporter`, defaults to "spec". * * @public - * @see {@link https://mochajs.org/#-r---reporter-name|CLI option} - * @see {@link https://mochajs.org/#reporters|Reporters} + * @see {@link /#-reporter-name-r-name|CLI option} + * @see {@link /#reporters|Reporters} * @param {String|Function} reporter - Reporter name or constructor. * @param {Object} [reporterOptions] - Options used to configure the reporter. * @returns {Mocha} this @@ -265,8 +265,8 @@ Mocha.prototype.reporter = function(reporter, reporterOptions) { * Sets test UI `name`, defaults to "bdd". * * @public - * @see {@link https://mochajs.org/#-u---ui-name|CLI option} - * @see {@link https://mochajs.org/#interfaces|Interface DSLs} + * @see {@link /#-ui-name-u-name|CLI option} + * @see {@link /#interfaces|Interface DSLs} * @param {string|Function} [ui=bdd] - Interface name or class. * @returns {Mocha} this * @chainable @@ -404,7 +404,7 @@ Mocha.prototype.fgrep = function(str) { * Previous filter value will be overwritten on each call! * * @public - * @see {@link https://mochajs.org/#-g---grep-pattern|CLI option} + * @see {@link /#grep-regexp-g-regexp|CLI option} * @see {@link Mocha#fgrep} * @see {@link Mocha#invert} * @param {RegExp|String} re - Regular expression used to select tests. @@ -474,7 +474,7 @@ Mocha.prototype.ignoreLeaks = function(ignoreLeaks) { * Enables checking for global variables leaked while running tests. * * @public - * @see {@link https://mochajs.org/#--check-leaks|CLI option} + * @see {@link /#-check-leaks|CLI option} * @see {@link Mocha#ignoreLeaks} * @return {Mocha} this * @chainable @@ -544,7 +544,7 @@ Mocha.prototype._growl = growl.notify; * Specifies whitelist of variable names to be expected in global scope. * * @public - * @see {@link https://mochajs.org/#-global-variable-name|CLI option} + * @see {@link /#-global-variable-name|CLI option} * @see {@link Mocha#checkLeaks} * @param {String[]|String} globals - Accepted global variable name(s). * @return {Mocha} this @@ -615,9 +615,8 @@ Mocha.prototype.hideDiff = function(hideDiff) { * If the value is `0`, timeouts will be disabled. * * @public - * @see {@link https://mochajs.org/#-t---timeout-ms|CLI option} - * @see {@link https://mochajs.org/#--no-timeouts|CLI option} - * @see {@link https://mochajs.org/#timeouts|Timeouts} + * @see {@link /#-timeout-ms-t-ms|CLI option} + * @see {@link /#timeouts|Timeouts} * @see {@link Mocha#enableTimeouts} * @param {number|string} msecs - Timeout threshold value. * @return {Mocha} this @@ -640,7 +639,7 @@ Mocha.prototype.timeout = function(msecs) { * Sets the number of times to retry failed tests. * * @public - * @see {@link https://mochajs.org/#retry-tests|Retry Tests} + * @see {@link /#retry-tests|Retry Tests} * @param {number} retry - Number of times to retry failed tests. * @return {Mocha} this * @chainable @@ -658,7 +657,7 @@ Mocha.prototype.retries = function(n) { * Sets slowness threshold value. * * @public - * @see {@link https://mochajs.org/#-s---slow-ms|CLI option} + * @see {@link /#-slow-ms-s-ms|CLI option} * @param {number} msecs - Slowness threshold value. * @return {Mocha} this * @chainable @@ -680,8 +679,7 @@ Mocha.prototype.slow = function(msecs) { * Enables or disables timeouts. * * @public - * @see {@link https://mochajs.org/#-t---timeout-ms|CLI option} - * @see {@link https://mochajs.org/#--no-timeouts|CLI option} + * @see {@link /#-timeout-ms-t-ms|CLI option} * @param {boolean} enableTimeouts - Whether to enable timeouts. * @return {Mocha} this * @chainable @@ -737,7 +735,7 @@ Mocha.prototype.allowUncaught = function() { * Used to perform asynch operations before any suites are run. * * @public - * @see {@link https://mochajs.org/#delayed-root-suite|delayed root suite} + * @see {@link /#delayed-root-suite|delayed root suite} * @returns {Mocha} this * @chainable */ diff --git a/lib/reporters/base.js b/lib/reporters/base.js index b1d026fcce..69db8f8ac7 100644 --- a/lib/reporters/base.js +++ b/lib/reporters/base.js @@ -307,7 +307,7 @@ function Base(runner, options) { * Outputs common epilogue used by many of the bundled reporters. * * @public - * @memberof Mocha.reporters.Base + * @memberof Mocha.reporters */ Base.prototype.epilogue = function() { var stats = this.stats; diff --git a/package-lock.json b/package-lock.json index 62eb962113..cd6c298e00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -325,9 +325,9 @@ } }, "@mocha/docdash": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@mocha/docdash/-/docdash-2.1.1.tgz", - "integrity": "sha512-D6l+L2rItDsO2bcc2Fl/REKDaOZMMUB1VYuFdgrM2Kk02DMCnhzZWyuBfXyNWfh3YplR38AJlOifx0dHutYD6g==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@mocha/docdash/-/docdash-2.1.2.tgz", + "integrity": "sha512-XQMLYVel+tWiNF9u74OX6GEzMbHh9WxrSRmOZjbmjRl5Gn1tdhNeGX5CA9wjf2OxdIe8RoJb63nqFM9wQVkdSA==", "dev": true, "requires": { "taffydb": "^2.7.3" @@ -421,6 +421,12 @@ "integrity": "sha512-J/tnbnj8HcsBgCe2apZbdUpQ7hs4d7oZNTYA5bekWdP0sr2NGsOpI/HRdDroEi209tEvTcTtxhD0FfED3DhEcw==", "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==", + "dev": true + }, "@types/q": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.2.tgz", @@ -493,9 +499,9 @@ } }, "acorn": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", - "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.0.0.tgz", + "integrity": "sha512-PaF/MduxijYYt7unVGRuds1vBC9bFxbNf+VWqhOClfdgy7RlVkQqt610ig1/yxTgsDIfW1cWDel5EBbOy3jdtQ==", "dev": true }, "acorn-dynamic-import": { @@ -723,7 +729,7 @@ "aproba": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "integrity": "sha1-aALmJk79GMeQobDVF/DyYnvyyUo=", "dev": true }, "arch": { @@ -1791,7 +1797,7 @@ "bn.js": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "integrity": "sha1-LN4J617jQfSEdGuwMJsyU7GxRC8=", "dev": true }, "body-parser": { @@ -2045,7 +2051,7 @@ "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==" + "integrity": "sha1-uqVZ7hTO1zRSIputcyZGfGH6vWA=" }, "browser-sync": { "version": "2.26.5", @@ -2728,12 +2734,20 @@ "dev": true }, "catharsis": { - "version": "0.8.10", - "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.10.tgz", - "integrity": "sha512-l2OUaz/3PU3MZylspVFJvwHCVfWyvcduPq4lv3AzZ2pJzZCo7kNKFNyatwujD7XgvGkNAE/Jhhbh2uARNwNkfw==", + "version": "0.8.11", + "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.11.tgz", + "integrity": "sha512-a+xUyMV7hD1BrDQA/3iPV7oc+6W26BgVJO05PGEoatMyIuPScQKsde6i3YorWX1qs+AZjnJ18NqdKoCtKiNh1g==", "dev": true, "requires": { - "lodash": "^4.17.11" + "lodash": "^4.17.14" + }, + "dependencies": { + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + } } }, "caw": { @@ -2889,7 +2903,7 @@ "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "integrity": "sha1-h2Dk7MJy9MNjUy+SbYdKriwTl94=", "dev": true, "requires": { "inherits": "^2.0.1", @@ -3559,7 +3573,7 @@ "createerror": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/createerror/-/createerror-1.3.0.tgz", - "integrity": "sha512-w9UZUtkaGd8MfS7eMG7Sa0lV5vCJghqQfiOnwNVrPhbZScUp5h0jwYoAF933MKlotlG1JAJOCCT3xU6r+SDKNw==", + "integrity": "sha1-xma9TNa5TjVBU5ZWnUZJ3QzbMxM=", "dev": true }, "cross-env": { @@ -4409,7 +4423,7 @@ "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==" + "integrity": "sha1-gAwN0eCov7yVg1wgKtIg/jF+WhI=" }, "diffie-hellman": { "version": "5.0.3", @@ -5062,7 +5076,7 @@ "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", "dev": true, "requires": { "ms": "2.0.0" @@ -5089,7 +5103,7 @@ "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", "dev": true, "requires": { "ms": "2.0.0" @@ -5135,7 +5149,7 @@ "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", "dev": true, "requires": { "ms": "2.0.0" @@ -5398,7 +5412,7 @@ }, "event-stream": { "version": "3.3.4", - "resolved": "http://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", + "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", "dev": true, "requires": { @@ -5426,7 +5440,7 @@ "evp_bytestokey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "integrity": "sha1-f8vbGY3HGVlDLv4ThCaE4FJaywI=", "dev": true, "requires": { "md5.js": "^1.3.4", @@ -6883,7 +6897,7 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=" }, "functional-red-black-tree": { "version": "1.0.1", @@ -7490,7 +7504,7 @@ "html-encoding-sniffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", - "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", + "integrity": "sha1-5w2EuU2lOqN14R/jo1G+ZkLKRvg=", "dev": true, "requires": { "whatwg-encoding": "^1.0.1" @@ -7732,6 +7746,323 @@ } } }, + "hyperlink": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/hyperlink/-/hyperlink-4.3.1.tgz", + "integrity": "sha512-IVo2B4k0ITQTgOf095qF2+ye5ZMC4F6N06yipBYClQ+wSI6vMT+GisoASP620zdYdxqge12cA0tSbs/GXFUtkw==", + "dev": true, + "requires": { + "assetgraph": "^5.12.0", + "async": "^3.1.0", + "optimist": "^0.6.1", + "pretty-bytes": "^5.2.0", + "request": "^2.88.0", + "tap-render": "github:Munter/tap-render#0.1.7-patch4", + "urltools": "^0.4.1" + }, + "dependencies": { + "acorn": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.0.0.tgz", + "integrity": "sha512-PaF/MduxijYYt7unVGRuds1vBC9bFxbNf+VWqhOClfdgy7RlVkQqt610ig1/yxTgsDIfW1cWDel5EBbOy3jdtQ==", + "dev": true + }, + "acorn-globals": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.3.tgz", + "integrity": "sha512-vkR40VwS2SYO98AIeFvzWWh+xyc2qi9s7OoXSFEGIP/rOJKzjnhykaZJNnHdoq4BL2gGxI5EZOU16z896EYnOQ==", + "dev": true, + "requires": { + "acorn": "^6.0.1", + "acorn-walk": "^6.0.1" + }, + "dependencies": { + "acorn": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.3.0.tgz", + "integrity": "sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==", + "dev": true + } + } + }, + "assetgraph": { + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/assetgraph/-/assetgraph-5.12.0.tgz", + "integrity": "sha512-w1ZQlYGFcjpE8jbSuE/+rWTq5xKvMWnR/WcYmtwFIYqyq9Ts7x6n3Hn8D7nDK5PT7rvO6DGnzI5Jguad97CD/w==", + "dev": true, + "requires": { + "acorn": "^7.0.0", + "acorn-jsx": "^5.0.1", + "bluebird": "^3.5.1", + "chalk": "^2.0.1", + "common-path-prefix": "^1.0.0", + "createerror": "^1.3.0", + "css-font-parser-papandreou": "^0.2.3-patch1", + "css-font-weight-names": "0.2.1", + "css-list-helpers": "2.0.0", + "cssnano": "^4.1.10", + "data-urls": "^1.0.0", + "domspace": "^1.2.1", + "esanimate": "^1.1.0", + "escodegen": "^1.12.0", + "espurify": "^2.0.1", + "estraverse": "^4.3.0", + "estraverse-fb": "^1.3.2", + "font-family-papandreou": "^0.2.0-patch1", + "font-snapper": "^1.0.0", + "font-tracer": "^1.1.0", + "fontkit": "^1.7.7", + "gettemporaryfilepath": "^1.0.0", + "glob": "^7.0.5", + "html-minifier": "^4.0.0", + "imageinfo": "^1.0.4", + "jsdom": "^15.0.0", + "lines-and-columns": "^1.1.6", + "lodash": "4.17.15", + "memoizesync": "1.1.1", + "mkdirp": "^0.5.1", + "normalizeurl": "^1.0.0", + "perfectionist": "^2.4.0", + "postcss": "^7.0.14", + "postcss-values-parser": "^2.0.0", + "read-pkg-up": "^6.0.0", + "repeat-string": "^1.5.4", + "schemes": "^1.0.1", + "semver": "^6.0.0", + "sift": "^7.0.1", + "source-map": "~0.6.1", + "specificity": "^0.4.0", + "sw-precache": "^5.2.0", + "teepee": "^2.31.1", + "terser": "^4.0.0", + "urltools": "^0.4.1", + "xmldom": "^0.1.27" + } + }, + "async": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/async/-/async-3.1.0.tgz", + "integrity": "sha512-4vx/aaY6j/j3Lw3fbCHNWP0pPaTCew3F6F3hYyl/tHs/ndmV1q7NW9T5yuJ2XAGwdQrP+6Wu20x06U4APo/iQQ==", + "dev": true + }, + "commander": { + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "dev": true + }, + "escodegen": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.12.0.tgz", + "integrity": "sha512-TuA+EhsanGcme5T3R0L80u4t8CpbXQjegRmf7+FPTJrtCTErXFeelblRgHQa1FofEzqYYJmJ/OqjTwREp9qgmg==", + "dev": true, + "requires": { + "esprima": "^3.1.3", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + } + }, + "esprima": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", + "dev": true + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "jsdom": { + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-15.1.1.tgz", + "integrity": "sha512-cQZRBB33arrDAeCrAEWn1U3SvrvC8XysBua9Oqg1yWrsY/gYcusloJC3RZJXuY5eehSCmws8f2YeliCqGSkrtQ==", + "dev": true, + "requires": { + "abab": "^2.0.0", + "acorn": "^6.1.1", + "acorn-globals": "^4.3.2", + "array-equal": "^1.0.0", + "cssom": "^0.3.6", + "cssstyle": "^1.2.2", + "data-urls": "^1.1.0", + "domexception": "^1.0.1", + "escodegen": "^1.11.1", + "html-encoding-sniffer": "^1.0.2", + "nwsapi": "^2.1.4", + "parse5": "5.1.0", + "pn": "^1.1.0", + "request": "^2.88.0", + "request-promise-native": "^1.0.7", + "saxes": "^3.1.9", + "symbol-tree": "^3.2.2", + "tough-cookie": "^3.0.1", + "w3c-hr-time": "^1.0.1", + "w3c-xmlserializer": "^1.1.2", + "webidl-conversions": "^4.0.2", + "whatwg-encoding": "^1.0.5", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^7.0.0", + "ws": "^7.0.0", + "xml-name-validator": "^3.0.0" + }, + "dependencies": { + "acorn": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.3.0.tgz", + "integrity": "sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==", + "dev": true + } + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "parse-json": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz", + "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1", + "lines-and-columns": "^1.1.6" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "postcss-values-parser": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/postcss-values-parser/-/postcss-values-parser-2.0.1.tgz", + "integrity": "sha512-2tLuBsA6P4rYTNKCXYG/71C7j1pU6pK503suYOmn4xYrQIzW+opD+7FAFNuGSdZC/3Qfy334QbeMu7MEb8gOxg==", + "dev": true, + "requires": { + "flatten": "^1.0.2", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + }, + "pretty-bytes": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.3.0.tgz", + "integrity": "sha512-hjGrh+P926p4R4WbaB6OckyRtO0F0/lQBiT+0gnxjV+5kjPBrfVBFCsCLbMqVQeydvIoouYTCmmEURiH3R1Bdg==", + "dev": true + }, + "read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "dependencies": { + "type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true + } + } + }, + "read-pkg-up": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-6.0.0.tgz", + "integrity": "sha512-odtTvLl+EXo1eTsMnoUHRmg/XmXdTkwXVxy4VFE9Kp6cCq7b3l7QMdBndND3eAFzrbSAXC/WCUOQQ9rLjifKZw==", + "dev": true, + "requires": { + "find-up": "^4.0.0", + "read-pkg": "^5.1.1", + "type-fest": "^0.5.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "terser": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.1.4.tgz", + "integrity": "sha512-+ZwXJvdSwbd60jG0Illav0F06GDJF0R4ydZ21Q3wGAFKoBGyJGo34F63vzJHgvYxc1ukOtIjvwEvl9MkjzM6Pg==", + "dev": true, + "requires": { + "commander": "^2.20.0", + "source-map": "~0.6.1", + "source-map-support": "~0.5.12" + } + }, + "tough-cookie": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz", + "integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==", + "dev": true, + "requires": { + "ip-regex": "^2.1.0", + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "ws": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.1.2.tgz", + "integrity": "sha512-gftXq3XI81cJCgkUiAVixA0raD9IVmXqsylCrjRygw4+UOOGzPoxnQ6r/CnVL9i+mDncJo94tSkyrtuuQVBmrg==", + "dev": true, + "requires": { + "async-limiter": "^1.0.0" + } + } + } + }, "icc": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/icc/-/icc-1.0.0.tgz", @@ -7974,6 +8305,12 @@ "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", "dev": true }, + "ip-regex": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", + "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", + "dev": true + }, "is-absolute": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", @@ -8315,7 +8652,7 @@ "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "integrity": "sha1-LBY7P6+xtgbZ0Xko8FwqHDjgdnc=", "dev": true, "requires": { "isobject": "^3.0.1" @@ -8723,31 +9060,31 @@ "dev": true }, "jsdoc": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.2.tgz", - "integrity": "sha512-S2vzg99C5+gb7FWlrK4TVdyzVPGGkdvpDkCEJH1JABi2PKzPeLu5/zZffcJUifgWUJqXWl41Hoc+MmuM2GukIg==", + "version": "3.6.3", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.3.tgz", + "integrity": "sha512-Yf1ZKA3r9nvtMWHO1kEuMZTlHOF8uoQ0vyo5eH7SQy5YeIiHM+B0DgKnn+X6y6KDYZcF7G2SPkKF+JORCXWE/A==", "dev": true, "requires": { "@babel/parser": "^7.4.4", "bluebird": "^3.5.4", - "catharsis": "^0.8.10", + "catharsis": "^0.8.11", "escape-string-regexp": "^2.0.0", "js2xmlparser": "^4.0.0", "klaw": "^3.0.0", "markdown-it": "^8.4.2", "markdown-it-anchor": "^5.0.2", - "marked": "^0.6.2", + "marked": "^0.7.0", "mkdirp": "^0.5.1", - "requizzle": "^0.2.2", + "requizzle": "^0.2.3", "strip-json-comments": "^3.0.1", "taffydb": "2.6.2", "underscore": "~1.9.1" }, "dependencies": { "@babel/parser": { - "version": "7.4.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.5.tgz", - "integrity": "sha512-9mUqkL1FF5T7f0WDFfAoDdiMVPWsdD1gZYzSnaXsxUCUqzuch/8of9G3VUSNiZmMBoRxT3neyVsqeiL/ZPcjew==", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.5.5.tgz", + "integrity": "sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g==", "dev": true }, "escape-string-regexp": { @@ -10172,7 +10509,7 @@ "markdown-toc": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/markdown-toc/-/markdown-toc-1.2.0.tgz", - "integrity": "sha512-eOsq7EGd3asV0oBfmyqngeEIhrbkc7XVP63OwcJBIhH2EpG2PzFcbZdhy1jutXSlRBBVMNXHvMtSr5LAxSUvUg==", + "integrity": "sha1-RKFWBoREkDFK/ARESD+eexEiwzk=", "dev": true, "requires": { "concat-stream": "^1.5.2", @@ -10279,9 +10616,9 @@ } }, "marked": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.6.2.tgz", - "integrity": "sha512-LqxwVH3P/rqKX4EKGz7+c2G9r98WeM/SW34ybhgNGhUQNKtf1GmmSkJ6cDGJ/t6tiyae49qRkpyTw2B9HOrgUA==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.7.0.tgz", + "integrity": "sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg==", "dev": true }, "matcher": { @@ -10493,7 +10830,7 @@ "miller-rabin": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "integrity": "sha1-8IA1HIZbDcViqEYpZtqlNUPHik0=", "dev": true, "requires": { "bn.js": "^4.0.0", @@ -10604,7 +10941,7 @@ "is-extendable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "integrity": "sha1-p0cPnkJnM9gb2B4RVSZOOjUHyrQ=", "dev": true, "requires": { "is-plain-object": "^2.0.4" @@ -10813,7 +11150,7 @@ "no-case": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", - "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==", + "integrity": "sha1-YLgTOWvjmz8SiKTB7V0efSi0ZKw=", "dev": true, "requires": { "lower-case": "^1.1.1" @@ -11093,7 +11430,7 @@ "npmlog": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "integrity": "sha1-CKfyqL9zRgR3mp76StXMcXq7lUs=", "dev": true, "requires": { "are-we-there-yet": "~1.1.2", @@ -11567,7 +11904,7 @@ }, "merge-source-map": { "version": "1.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", "dev": true, "requires": { @@ -12312,7 +12649,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "^1.1.3", @@ -12593,7 +12930,7 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", "dev": true }, "supports-color": { @@ -12963,7 +13300,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", "dev": true, "requires": { "chalk": "^1.1.3", @@ -13069,7 +13406,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, @@ -14080,12 +14417,20 @@ "dev": true }, "requizzle": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.2.tgz", - "integrity": "sha512-oJ6y7JcUJkblRGhMByGNcszeLgU0qDxNKFCiUZR1XyzHyVsev+Mxb1tyygxLd1ORsKee1SA5BInFdUwY64GE/A==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz", + "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==", "dev": true, "requires": { - "lodash": "^4.17.11" + "lodash": "^4.17.14" + }, + "dependencies": { + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + } } }, "resolve": { @@ -14334,7 +14679,7 @@ "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "integrity": "sha1-KBYjTiN4vdxOU1T6tcqold9xANk=", "dev": true }, "saxes": { @@ -15977,6 +16322,23 @@ "integrity": "sha1-KtNxaWKUmPylvIQkMJbTzeDsOjQ=", "dev": true }, + "tap-render": { + "version": "github:Munter/tap-render#c3a72d6260ee19cfd340d1e41d73a0edfdb29d94", + "from": "github:Munter/tap-render#0.1.7-patch4", + "dev": true, + "requires": { + "jsonify": "0.0.0", + "pause-stream": "0.0.7" + }, + "dependencies": { + "pause-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.7.tgz", + "integrity": "sha1-/kDjE8ZcDyqh0WeTPEJeTLJMtTc=", + "dev": true + } + } + }, "tapable": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", @@ -16422,7 +16784,7 @@ "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "integrity": "sha1-bTQzWIl2jSGyvNoKonfO07G/rfk=", "dev": true, "requires": { "os-tmpdir": "~1.0.2" @@ -16642,6 +17004,12 @@ "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, + "type-fest": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.5.2.tgz", + "integrity": "sha512-DWkS49EQKVX//Tbupb9TFa19c7+MK1XmzkrZUR8TAktmE/DizXoaoJV6TZ/tSIPXipqNiRI6CyAe7x69Jb6RSw==", + "dev": true + }, "type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -17386,7 +17754,7 @@ "webidl-conversions": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "integrity": "sha1-qFWYCx8LazWbodXZ+zmulB+qY60=", "dev": true }, "whatwg-encoding": { @@ -17491,6 +17859,14 @@ "requires": { "acorn": "^3.1.0", "acorn-globals": "^3.0.0" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } } }, "wordwrap": { @@ -17501,7 +17877,7 @@ }, "wrap-ansi": { "version": "2.1.0", - "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "dev": true, "requires": { diff --git a/package-scripts.js b/package-scripts.js index 7febdc016f..f4d1dc9845 100644 --- a/package-scripts.js +++ b/package-scripts.js @@ -266,7 +266,7 @@ module.exports = { docs: { default: { script: - 'nps docs.prebuild && nps docs.api && eleventy && nps docs.postbuild', + 'nps docs.prebuild && nps docs.api && eleventy && nps docs.linkcheck && nps docs.postbuild', description: 'Build documentation' }, prebuild: { @@ -274,6 +274,10 @@ module.exports = { description: 'Prepare system for doc building', hiddenFromHelp: true }, + linkcheck: { + script: + 'hyperlink -ri --canonicalroot https://mochajs.org --skip ".js.html#line" docs/_site/index.html' + }, postbuild: { script: 'buildProduction docs/_site/index.html --outroot docs/_dist --canonicalroot https://mochajs.org/ --optimizeimages --svgo --inlinehtmlimage 9400 --inlinehtmlscript 0 --asyncscripts && cp docs/_headers docs/_dist/_headers && node scripts/netlify-headers.js >> docs/_dist/_headers', diff --git a/package.json b/package.json index 07b81c9c7d..f53ea0ba15 100644 --- a/package.json +++ b/package.json @@ -539,7 +539,8 @@ "devDependencies": { "@11ty/eleventy": "^0.8.3", "@mocha/contributors": "^1.0.4", - "@mocha/docdash": "^2.1.1", + "@mocha/docdash": "^2.1.2", + "acorn": "^7.0.0", "assetgraph-builder": "^6.10.1", "autoprefixer": "^9.6.0", "browserify": "^16.2.3", @@ -560,7 +561,8 @@ "eslint-plugin-standard": "^4.0.0", "fs-extra": "^8.0.1", "husky": "^1.3.1", - "jsdoc": "^3.6.2", + "hyperlink": "^4.3.1", + "jsdoc": "^3.6.3", "karma": "^4.1.0", "karma-browserify": "^6.0.0", "karma-chrome-launcher": "^2.2.0", From f15e9884eba81172e4d2990b5aeb44391b83443b Mon Sep 17 00:00:00 2001 From: Juerg B <44573692+juergba@users.noreply.github.com> Date: Mon, 26 Aug 2019 10:54:03 +0200 Subject: [PATCH 010/396] Soft deprecate configuration via "mocha.opts" (#3968) --- docs/index.md | 8 ++++---- example/config/.mocharc.js | 2 +- example/config/.mocharc.json | 2 +- example/config/.mocharc.jsonc | 2 +- example/config/.mocharc.yml | 2 +- lib/cli/options.js | 4 ++++ lib/cli/run.js | 2 +- test/integration/options/opts.spec.js | 18 ++++++++++++++++++ 8 files changed, 31 insertions(+), 9 deletions(-) diff --git a/docs/index.md b/docs/index.md index 3e00e3468e..be1511ef9e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1065,7 +1065,7 @@ By default, Mocha will search for a config file if `--config` is not specified; ### `--opts ` -> _Updated in v6.0.0; added `--no-opts`._ +> _Deprecated._ Specify a path to [`mocha.opts`](#mochaopts). @@ -1636,14 +1636,14 @@ tests as shown below: > _New in v6.0.0_ -In addition to supporting the legacy [`mocha.opts`](#mochaopts) run-control format, Mocha now supports configuration files, typical of modern command-line tools, in several formats: +In addition to supporting the deprecated [`mocha.opts`](#mochaopts) run-control format, Mocha now supports configuration files, typical of modern command-line tools, in several formats: - **JavaScript**: Create a `.mocharc.js` in your project's root directory, and export an object (`module.exports = {/* ... */}`) containing your configuration. - **YAML**: Create a `.mocharc.yaml` (or `.mocharc.yml`) in your project's root directory. - **JSON**: Create a `.mocharc.json` (or `.mocharc.jsonc`) in your project's root directory. Comments — while not valid JSON — are allowed in this file, and will be ignored by Mocha. - **package.json**: Create a `mocha` property in your project's `package.json`. -Mocha suggests using one of the above strategies for configuration instead of the legacy `mocha.opts` format. +Mocha suggests using one of the above strategies for configuration instead of the deprecated `mocha.opts` format. ### Custom Locations @@ -1693,7 +1693,7 @@ Configurations can inherit from other modules using the `extends` keyword. See [ ## `mocha.opts` -> _Updated in v6.0.0; `mocha.opts` is now considered "legacy" — though not yet deprecated — and we recommend using a configuration file instead._ +> _`mocha.opts` file support is DEPRECATED and will be removed from a future version of Mocha. We recommend using a configuration file instead._ Mocha will attempt to load `"./test/mocha.opts"` as a run-control file of sorts. diff --git a/example/config/.mocharc.js b/example/config/.mocharc.js index 5d9c7fa770..9b58a28d51 100644 --- a/example/config/.mocharc.js +++ b/example/config/.mocharc.js @@ -7,7 +7,7 @@ module.exports = { diff: true, extension: ['js'], - opts: './test/mocha.opts', + opts: false, package: './package.json', reporter: 'spec', slow: 75, diff --git a/example/config/.mocharc.json b/example/config/.mocharc.json index 07f954da67..5fa8f762e8 100644 --- a/example/config/.mocharc.json +++ b/example/config/.mocharc.json @@ -5,7 +5,7 @@ { "diff": true, "extension": ["js"], - "opts": "./test/mocha.opts", + "opts": false, "package": "./package.json", "reporter": "spec", "slow": 75, diff --git a/example/config/.mocharc.jsonc b/example/config/.mocharc.jsonc index d86055f870..49152a186d 100644 --- a/example/config/.mocharc.jsonc +++ b/example/config/.mocharc.jsonc @@ -5,7 +5,7 @@ { "diff": true, "extension": ["js"], - "opts": "./test/mocha.opts", + "opts": false, "package": /* 📦 */ "./package.json", "reporter": /* 📋 */ "spec", "slow": 75, diff --git a/example/config/.mocharc.yml b/example/config/.mocharc.yml index 466b4956f1..4004d47720 100644 --- a/example/config/.mocharc.yml +++ b/example/config/.mocharc.yml @@ -28,7 +28,7 @@ ignore: inline-diffs: false # needs to be used with grep or fgrep # invert: false -opts: './test/mocha.opts' +opts: false recursive: false reporter: spec reporter-option: diff --git a/lib/cli/options.js b/lib/cli/options.js index ffbca06396..c87552c542 100644 --- a/lib/cli/options.js +++ b/lib/cli/options.js @@ -15,6 +15,7 @@ const mocharc = require('../mocharc.json'); const {list} = require('./run-helpers'); const {loadConfig, findConfig} = require('./config'); const findUp = require('find-up'); +const {deprecate} = require('../utils'); const debug = require('debug')('mocha:cli:options'); const {isNodeFlag} = require('./node-flags'); @@ -196,6 +197,9 @@ const loadMochaOpts = (args = {}) => { // if there's an exception to catch here, I'm not sure what it is. // by attaching the `no-opts` arg, we avoid re-parsing of `mocha.opts`. if (mochaOpts) { + deprecate( + 'Configuration via mocha.opts is DEPRECATED and will be removed from a future version of Mocha. Use RC files or package.json instead.' + ); result = parse(parseMochaOpts(mochaOpts)); debug(`${filepath} parsed succesfully`); } diff --git a/lib/cli/run.js b/lib/cli/run.js index dc94c101a4..b0a16e6bdf 100644 --- a/lib/cli/run.js +++ b/lib/cli/run.js @@ -166,7 +166,7 @@ exports.builder = yargs => }, opts: { default: defaults.opts, - description: 'Path to `mocha.opts`', + description: 'Path to `mocha.opts` (DEPRECATED)', group: GROUPS.CONFIG, normalize: true, requiresArg: true diff --git a/test/integration/options/opts.spec.js b/test/integration/options/opts.spec.js index 51f49fec8b..e3d98581ed 100644 --- a/test/integration/options/opts.spec.js +++ b/test/integration/options/opts.spec.js @@ -10,6 +10,24 @@ describe('--opts', function() { var args = []; var fixture = path.join('options', 'opts'); + it('should print a deprecation warning', function(done) { + var mochaOpts = path.join('test', 'opts', 'mocha.opts'); + args = [resolvePath(fixture), '--opts', mochaOpts]; + invokeMocha( + args, + function(err, res) { + if (err) { + return done(err); + } + + expect(res, 'to have passed'); + expect(res.output, 'to contain', 'mocha.opts is DEPRECATED'); + done(); + }, + 'pipe' + ); + }); + it('should work despite nonexistent default options file', function(done) { args = []; runMochaJSON(fixture, args, function(err, res) { From d8ac68ff79d112e69ed40eabf574d2706bb13a44 Mon Sep 17 00:00:00 2001 From: Craig Taub Date: Sat, 31 Aug 2019 11:55:38 +0100 Subject: [PATCH 011/396] Adopt the OpenJSF Code of Conduct (#3971) * OJSF coc * update email --- .github/CODE_OF_CONDUCT.md | 54 +++++++++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md index 2b4375ee2f..06fc2b30ed 100644 --- a/.github/CODE_OF_CONDUCT.md +++ b/.github/CODE_OF_CONDUCT.md @@ -33,14 +33,14 @@ community should be respectful when dealing with other members as well as with p We are a community of professionals, and we conduct ourselves professionally. Be kind to others. Do not insult or put down other participants. Harassment and other exclusionary behavior aren’t acceptable. This includes, but is not limited to: -* Violent threats or language directed against another person. -* Discriminatory jokes and language. -* Posting sexually explicit or violent material. -* Posting (or threatening to post) other people’s personally identifying information (“doxing”). -* Personal insults, especially those using racist or sexist terms. -* Unwelcome sexual attention. -* Advocating for, or encouraging, any of the above behavior. -* Repeated harassment of others. In general, if someone asks you to stop, then stop. +- Violent threats or language directed against another person. +- Discriminatory jokes and language. +- Posting sexually explicit or violent material. +- Posting (or threatening to post) other people’s personally identifying information (“doxing”). +- Personal insults, especially those using racist or sexist terms. +- Unwelcome sexual attention. +- Advocating for, or encouraging, any of the above behavior. +- Repeated harassment of others. In general, if someone asks you to stop, then stop. ## When we disagree, try to understand why @@ -55,4 +55,40 @@ Original text courtesy of the Speak Up! project and Django Project. ## QUESTIONS? -If you have questions, please see the FAQ. If that doesn’t answer your questions, feel free to email conduct@js.foundation. +If you have questions, please see the FAQ. If that doesn’t answer your questions, feel free to email report@lists.openjsf.org. + +# OpenJS Foundation Code of Conduct + +The OpenJS Foundation and its member projects use the Contributor +Covenant v1.4.1 as its Code of Conduct. Refer to the following +for the full text: + +- [english](https://www.contributor-covenant.org/version/1/4/code-of-conduct) +- [translations](https://www.contributor-covenant.org/translations) + +Refer to the section on reporting and escalation in this document for the specific emails that can be used to report and escalate issues. + +## Reporting + +### Project Spaces + +For reporting issues in spaces related to a member project please use the email provided by the project for reporting. Projects handle CoC issues related to the spaces that they maintain. Projects maintainers commit to: + +- maintain the confidentiality with regard to the reporter of an incident +- to participate in the path for escalation as outlined in + the section on Escalation when required. + +### Foundation Spaces + +For reporting issues in spaces managed by the OpenJS Foundation, for example, repositories within the OpenJS organization, use the email `report@lists.openjsf.org`. The Cross Project Council (CPC) is responsible for managing these reports and commits to: + +- maintain the confidentiality with regard to the reporter of an incident +- to participate in the path for escalation as outlined in + the section on Escalation when required. + +## Escalation + +The OpenJS Foundation maintains a Code of Conduct Panel (CoCP). This is a foundation-wide team established to manage escalation when a reporter believes that a report to a member project or the CPC has not been properly handled. In order to escalate to the CoCP send an email to `"coc-escalation@lists.openjsf.org`. + +For more information, refer to the full +[Code of Conduct governance document](https://github.com/openjs-foundation/bootstrap/blob/master/proposals/stage-1/CODE_OF_CONDUCT/FOUNDATION_CODE_OF_CONDUCT_REQUIREMENTS.md). From 802fb0593a9a4d094e2290582760c2b43529fbd1 Mon Sep 17 00:00:00 2001 From: Juerg B <44573692+juergba@users.noreply.github.com> Date: Tue, 3 Sep 2019 08:48:40 +0200 Subject: [PATCH 012/396] Deprecate "debug" and remove "--debug" / "--debug-brk" flags (#3890) --- bin/mocha | 51 +++------------- docs/index.md | 57 +++++++++--------- lib/cli/node-flags.js | 2 +- lib/cli/run.js | 2 +- test/integration/options/debug.spec.js | 80 -------------------------- test/node-unit/cli/node-flags.spec.js | 4 +- 6 files changed, 41 insertions(+), 155 deletions(-) delete mode 100644 test/integration/options/debug.spec.js diff --git a/bin/mocha b/bin/mocha index 865f5b1f07..4b0ab8ff86 100755 --- a/bin/mocha +++ b/bin/mocha @@ -10,7 +10,7 @@ * @private */ -const {deprecate, warn} = require('../lib/utils'); +const {deprecate} = require('../lib/utils'); const {loadOptions} = require('../lib/cli/options'); const { unparseNodeFlags, @@ -20,7 +20,6 @@ const { const unparse = require('yargs-unparser'); const debug = require('debug')('mocha:cli:mocha'); const {aliases} = require('../lib/cli/run-option-metadata'); -const nodeEnv = require('node-environment-flags'); const mochaArgs = {}; const nodeArgs = {}; @@ -63,51 +62,19 @@ Object.keys(opts).forEach(opt => { // Native debugger handling // see https://nodejs.org/api/debugger.html#debugger_debugger -// look for 'debug' or 'inspect' that would launch this debugger, +// look for 'inspect' or 'debug' that would launch this debugger, // remove it from Mocha's opts and prepend it to Node's opts. -// also coerce depending on Node.js version. // A deprecation warning will be printed by node, if applicable. // (mochaArgs._ are "positional" arguments, not prefixed with - or --) -if (/^(debug|inspect)$/.test(mochaArgs._[0])) { - const command = mochaArgs._.shift(); - disableTimeouts(command); - // don't conflict with inspector - ['debug', 'inspect', 'debug-brk', 'inspect-brk'] - .filter(opt => opt in nodeArgs || opt in mochaArgs) - .forEach(opt => { - warn(`command "${command}" provided; --${opt} ignored`); - delete nodeArgs[opt]; - delete mochaArgs[opt]; - }); - nodeArgs._ = [ - parseInt( - process.version - .slice(1) - .split('.') - .shift(), - 10 - ) >= 8 - ? 'inspect' - : 'debug' - ]; +if (mochaArgs._) { + const i = mochaArgs._.findIndex(val => val === 'inspect' || val === 'debug'); + if (i > -1) { + const [command] = mochaArgs._.splice(i, 1); + disableTimeouts('inspect'); + nodeArgs._ = [command]; + } } -// allow --debug to invoke --inspect on Node.js v8 or newer. -['debug', 'debug-brk'] - .filter(opt => opt in nodeArgs && !nodeEnv.has(opt)) - .forEach(opt => { - const newOpt = opt === 'debug' ? 'inspect' : 'inspect-brk'; - warn( - `"--${opt}" is not available in Node.js ${ - process.version - }; use "--${newOpt}" instead.` - ); - nodeArgs[newOpt] = nodeArgs[opt]; - mochaArgs.timeout = false; - debug(`--${opt} -> ${newOpt}`); - delete nodeArgs[opt]; - }); - // historical if (nodeArgs.gc) { deprecate( diff --git a/docs/index.md b/docs/index.md index be1511ef9e..50b5536aeb 100644 --- a/docs/index.md +++ b/docs/index.md @@ -39,7 +39,7 @@ Mocha is a feature-rich JavaScript test framework running on [Node.js][] and in - [config file support](#-config-path) - [mocha.opts file support](#-opts-path) - clickable suite titles to filter test execution -- [node debugger support](#-debug-inspect-debug-brk-inspect-brk-debug-inspect) +- [node debugger support](#-inspect-inspect-brk-inspect) - [detects multiple calls to `done()`](#detects-multiple-calls-to-done) - [use any assertion library you want](#assertions) - [extensible reporting, bundled with 9+ reporters](#reporters) @@ -828,8 +828,8 @@ mocha [spec..] Run tests with Mocha Commands - mocha debug [spec..] Run tests with Mocha [default] - mocha init create a client-side Mocha setup at + mocha inspect [spec..] Run tests with Mocha [default] + mocha init create a client-side Mocha setup at Rules & Behavior --allow-uncaught Allow uncaught errors to propagate [boolean] @@ -844,9 +844,9 @@ Rules & Behavior --global, --globals List of allowed global variables [array] --retries Retry failed tests this many times [number] --slow, -s Specify "slow" test threshold (in milliseconds) - [number] [default: 75] + [string] [default: 75] --timeout, -t, --timeouts Specify test timeout threshold (in milliseconds) - [number] [default: 2000] + [string] [default: 2000] --ui, -u Specify user interface [string] [default: "bdd"] Reporting & Output @@ -863,17 +863,18 @@ Reporting & Output -O () [array] Configuration - --config Path to config file [default: (nearest rc file)] - --opts Path to `mocha.opts` [string] [default: "./test/mocha.opts"] + --config Path to config file [string] [default: (nearest rc file)] + --opts Path to `mocha.opts` (DEPRECATED) + [string] [default: "./test/mocha.opts"] --package Path to package.json for config [string] File Handling - --ignore, --exclude Ignore file(s) or glob pattern(s) - [array] [default: (none)] --extension, --watch-extensions File extension(s) to load and/or watch [array] [default: js] --file Specify file(s) to be loaded prior to root suite execution [array] [default: (none)] + --ignore, --exclude Ignore file(s) or glob pattern(s) + [array] [default: (none)] --recursive Look for tests in subdirectories [boolean] --require, -r Require module [array] [default: (none)] --sort, -S Sort test files [boolean] @@ -890,10 +891,10 @@ Positional Arguments [array] [default: ["test"]] Other Options - --help, -h Show usage information & exit [boolean] - --version, -V Show version number & exit [boolean] - --list-interfaces List built-in user interfaces & exit [boolean] - --list-reporters List built-in reporters & exit [boolean] + --help, -h Show usage information & exit [boolean] + --version, -V Show version number & exit [boolean] + --list-interfaces List built-in user interfaces & exit [boolean] + --list-reporters List built-in reporters & exit [boolean] Mocha Resources Chat: https://gitter.im/mochajs/mocha @@ -987,7 +988,7 @@ 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 debug flags. It is equivalent to `--timeout 0`. `--timeout 99999999` is no longer needed._ +> _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._ 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. @@ -1079,14 +1080,6 @@ Specify an explicit path to a [`package.json` file](#configuring-mocha-nodejs) ( By default, Mocha looks for a `package.json` in the current working directory or nearest ancestor, and will use the first file found (regardless of whether it contains a `mocha` property); to suppress `package.json` lookup, use `--no-package`. -### `--ignore ` - -Explicitly ignore (exclude) one or more test files, directories or globs (e.g., `some/**/files*`) that would otherwise be loaded. - -Files specified using `--file` _are not affected_ by this option. - -Can be specified multiple times. - ### `--extension , --watch-extensions ` > _Updated in v6.0.0. Previously `--watch-extensions`, but now expanded to affect general test file loading behavior. `--watch-extensions` is now an alias_ @@ -1099,7 +1092,7 @@ Specifying `--extension` will _remove_ `.js` as a test file extension; use `--ex ### `--file ` -Explicitly _include_ a test file to be loaded before other test files files. Multiple uses of `--file` are allowed, and will be loaded in order given. +Explicitly _include_ a test file to be loaded before other test files. Multiple uses of `--file` are allowed, and will be loaded in order given. Useful if you want to declare, for example, hooks to be run before every test across all other test files. @@ -1107,6 +1100,14 @@ Files specified this way are not affected by `--sort` or `--recursive`. Files specified in this way should contain one or more suites, tests or hooks. If this is not the case, consider `--require` instead. +### `--ignore , --exclude ,` + +Explicitly ignore (exclude) one or more test files, directories or globs (e.g., `some/**/files*`) that would otherwise be loaded. + +Files specified using `--file` _are not affected_ by this option. + +Can be specified multiple times. + ### `--recursive` When looking for test files, recurse into subdirectories. @@ -1178,15 +1179,15 @@ Use the _inverse_ of the match specified by `--grep` or `fgrep`. Requires either `--grep` or `--fgrep` (but not both). -### `--debug, --inspect, --debug-brk, --inspect-brk, debug, inspect` +### `--inspect, --inspect-brk, inspect` -> _BREAKING CHANGE in v6.0.0; `-d` is no longer an alias for `--debug`. Other updates in v6.0.0: In versions of Node.js implementing `--inspect` and `--inspect-brk`, `--debug` and `--debug-brk` are respectively aliases for these two options. Likewise, `debug` (not `--debug`) is an alias for `inspect` (not `--inspect`) in Node.js versions where `debug` is deprecated._ +> _BREAKING CHANGE in v7.0.0; `--debug` / `--debug-brk` are removed and `debug` is deprecated._ -Enables Node.js' debugger or inspector. +Enables Node.js' inspector. -Use `--inspect` / `--inspect-brk` / `--debug` / `--debug-brk` to launch the V8 inspector for use with Chrome Dev Tools. +Use `--inspect` / `--inspect-brk` to launch the V8 inspector for use with Chrome Dev Tools. -Use `inspect` / `debug` to launch Node.js' internal debugger. +Use `inspect` to launch Node.js' internal debugger. All of these options are mutually exclusive. diff --git a/lib/cli/node-flags.js b/lib/cli/node-flags.js index feffaa93e2..8d378e1bf2 100644 --- a/lib/cli/node-flags.js +++ b/lib/cli/node-flags.js @@ -14,7 +14,7 @@ const unparse = require('yargs-unparser'); * @see {@link impliesNoTimeouts} * @private */ -const debugFlags = new Set(['debug', 'debug-brk', 'inspect', 'inspect-brk']); +const debugFlags = new Set(['inspect', 'inspect-brk']); /** * Mocha has historical support for various `node` and V8 flags which might not diff --git a/lib/cli/run.js b/lib/cli/run.js index b0a16e6bdf..9adb602ca3 100644 --- a/lib/cli/run.js +++ b/lib/cli/run.js @@ -38,7 +38,7 @@ const GROUPS = { CONFIG: 'Configuration' }; -exports.command = ['$0 [spec..]', 'debug [spec..]']; +exports.command = ['$0 [spec..]', 'inspect']; exports.describe = 'Run tests with Mocha'; diff --git a/test/integration/options/debug.spec.js b/test/integration/options/debug.spec.js deleted file mode 100644 index 297aee91f6..0000000000 --- a/test/integration/options/debug.spec.js +++ /dev/null @@ -1,80 +0,0 @@ -'use strict'; - -var helpers = require('../helpers'); -var invokeMocha = helpers.invokeMocha; -var DEFAULT_FIXTURE = helpers.DEFAULT_FIXTURE; - -describe('--debug', function() { - describe('Node.js v8+', function() { - before(function() { - if (process.version.substring(0, 2) === 'v6') { - this.skip(); - } - }); - - it('should invoke --inspect', function(done) { - invokeMocha( - ['--debug', DEFAULT_FIXTURE], - function(err, res) { - if (err) { - return done(err); - } - expect(res, 'to contain output', /Debugger listening/i); - done(); - }, - 'pipe' - ); - }); - - it('should invoke --inspect-brk', function(done) { - var proc = invokeMocha( - ['--debug-brk', DEFAULT_FIXTURE], - function(err, res) { - if (err) { - return done(err); - } - expect(res, 'to contain output', /Debugger listening/i); - done(); - }, - 'pipe' - ); - - // debugger must be manually killed - setTimeout(function() { - process.kill(proc.pid, 'SIGINT'); - }, 2000); - }); - - it('should respect custom host/port', function(done) { - invokeMocha( - ['--debug=127.0.0.1:9229', DEFAULT_FIXTURE], - function(err, res) { - if (err) { - return done(err); - } - expect( - res, - 'to contain output', - /Debugger listening on .*127.0.0.1:9229/i - ); - done(); - }, - 'pipe' - ); - }); - - it('should warn about incorrect usage for version', function(done) { - invokeMocha( - ['--debug=127.0.0.1:9229', DEFAULT_FIXTURE], - function(err, res) { - if (err) { - return done(err); - } - expect(res, 'to contain output', /"--debug" is not available/i); - done(); - }, - 'pipe' - ); - }); - }); -}); diff --git a/test/node-unit/cli/node-flags.spec.js b/test/node-unit/cli/node-flags.spec.js index 1347f256a9..9871088117 100644 --- a/test/node-unit/cli/node-flags.spec.js +++ b/test/node-unit/cli/node-flags.spec.js @@ -86,10 +86,8 @@ describe('node-flags', function() { }); describe('impliesNoTimeouts()', function() { - it('should return true for debug/inspect flags', function() { - expect(impliesNoTimeouts('debug'), 'to be true'); + it('should return true for inspect flags', function() { expect(impliesNoTimeouts('inspect'), 'to be true'); - expect(impliesNoTimeouts('debug-brk'), 'to be true'); expect(impliesNoTimeouts('inspect-brk'), 'to be true'); }); }); From 123a0d77beedad032aa6bba175de9eb724204913 Mon Sep 17 00:00:00 2001 From: Thomas Scholtes Date: Mon, 9 Sep 2019 13:34:43 +0200 Subject: [PATCH 013/396] Improved watching with chokidar (#3980) Improved watching with chokidar. This change improves the file watching behavior and fixes #3912. * We introduce the `--watch-files` command line option. This option allows control over which files are and is separate and more powerful than `--extension`. Fixes #2702. * We introduce the `--watch-ignore` command line option that allows control over which files are not watched. Before this was hardcoded to `node_modules` and `.git`. See #2554. * The `chokidar` package now handles file watching. * New test files are picked up by the file watcher and run. Fixes #2176. * Watch hidden files based on extension --- docs/index.md | 34 ++- example/config/.mocharc.js | 4 +- example/config/.mocharc.json | 4 +- example/config/.mocharc.jsonc | 5 +- example/config/.mocharc.yml | 5 + lib/cli/run-helpers.js | 7 +- lib/cli/run-option-metadata.js | 7 +- lib/cli/run.js | 15 +- lib/cli/watch-run.js | 137 +++++++-- lib/mocharc.json | 3 +- lib/utils.js | 74 ----- package-lock.json | 398 ++++++++++++++++++------- package-scripts.js | 2 +- package.json | 4 +- test/integration/file-utils.spec.js | 24 -- test/integration/options/watch.spec.js | 168 ++++++++++- test/node-unit/cli/options.spec.js | 3 +- 17 files changed, 625 insertions(+), 269 deletions(-) diff --git a/docs/index.md b/docs/index.md index 50b5536aeb..7da5a1cc6f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1080,16 +1080,14 @@ Specify an explicit path to a [`package.json` file](#configuring-mocha-nodejs) ( By default, Mocha looks for a `package.json` in the current working directory or nearest ancestor, and will use the first file found (regardless of whether it contains a `mocha` property); to suppress `package.json` lookup, use `--no-package`. -### `--extension , --watch-extensions ` - -> _Updated in v6.0.0. Previously `--watch-extensions`, but now expanded to affect general test file loading behavior. `--watch-extensions` is now an alias_ +### `--extension ` Files having this extension will be considered test files. Defaults to `js`. -Affects `--watch` behavior. - Specifying `--extension` will _remove_ `.js` as a test file extension; use `--extension js` to re-add it. For example, to load `.mjs` and `.js` test files, you must supply `--extension mjs --extension js`. +The option can be given multiple times. The option accepts a comma-delimited list: `--extension a,b` is equivalent to `--extension a --extension b` + ### `--file ` Explicitly _include_ a test file to be loaded before other test files. Multiple uses of `--file` are allowed, and will be loaded in order given. @@ -1133,9 +1131,31 @@ Sort test files (by absolute path) using [Array.prototype.sort][mdn-array-sort]. ### `--watch, -w` -Executes tests on changes to JavaScript in the current working directory (and once initially). +Rerun tests on file changes. + +The `--watch-files` and `--watch-ignore` options can be used to control which files are watched for changes. + +### `--watch-files ` + +> _New in v7.0.0_ + +List of paths or globs to watch when `--watch` is set. If a file matching the given glob changes or is added or removed mocha will rerun all tests. + +If the path is a directory all files and subdirectories will be watched. + +By default all files in the current directory having one of the extensions provided by `--extension` and not contained in the `node_modules` or `.git` folders are watched. + +The option can be given multiple times. The option accepts a comma-delimited list: `--watch-files a,b` is equivalent to `--watch-files a --watch-files b` + +### `--watch-ignore ` + +> _New in v7.0.0_ + +List of paths or globs to exclude from watching. Defaults to `node_modules` and `.git`. + +To exclude all files in a directory it is preferable to use `foo/bar` instead of `foo/bar/**/*`. The latter will still watch the directory `foo/bar` but will ignore all changes to the content of that directory. -By default, only files with extension `.js` are watched. Use `--extension` to change this behavior. +The option can be given multiple times. The option accepts a comma-delimited list: `--watch-ignore a,b` is equivalent to `--watch-ignore a --watch-ignore b` ### `--fgrep , -f ` diff --git a/example/config/.mocharc.js b/example/config/.mocharc.js index 9b58a28d51..671520cd53 100644 --- a/example/config/.mocharc.js +++ b/example/config/.mocharc.js @@ -12,5 +12,7 @@ module.exports = { reporter: 'spec', slow: 75, timeout: 2000, - ui: 'bdd' + ui: 'bdd', + 'watch-files': ['lib/**/*.js', 'test/**/*.js'], + 'watch-ignore': ['lib/vendor'] }; diff --git a/example/config/.mocharc.json b/example/config/.mocharc.json index 5fa8f762e8..43a83e6b0f 100644 --- a/example/config/.mocharc.json +++ b/example/config/.mocharc.json @@ -10,5 +10,7 @@ "reporter": "spec", "slow": 75, "timeout": 2000, - "ui": "bdd" + "ui": "bdd", + "watch-files": ["lib/**/*.js", "test/**/*.js"], + "watch-ignore": ["lib/vendor"] } diff --git a/example/config/.mocharc.jsonc b/example/config/.mocharc.jsonc index 49152a186d..25a40b6821 100644 --- a/example/config/.mocharc.jsonc +++ b/example/config/.mocharc.jsonc @@ -10,5 +10,8 @@ "reporter": /* 📋 */ "spec", "slow": 75, "timeout": 2000, - "ui": "bdd" + "ui": "bdd", + // Camel-casing options are also accepted + "watchFiles": ["lib/**/*.js", "test/**/*.js"], + "watchIgnore": ["lib/vendor"] } diff --git a/example/config/.mocharc.yml b/example/config/.mocharc.yml index 4004d47720..226f8184ca 100644 --- a/example/config/.mocharc.yml +++ b/example/config/.mocharc.yml @@ -44,3 +44,8 @@ trace-warnings: true # node flags ok ui: bdd v8-stack-trace-limit: 100 # V8 flags are prepended with "v8-" watch: false +watch-files: + - 'lib/**/*.js' + - 'test/**/*.js' +watch-ignore: + - 'lib/vendor' diff --git a/lib/cli/run-helpers.js b/lib/cli/run-helpers.js index 7b3c7aa4fe..6c662a665f 100644 --- a/lib/cli/run-helpers.js +++ b/lib/cli/run-helpers.js @@ -118,13 +118,14 @@ exports.runMocha = (mocha, options) => { const { watch = false, extension = [], - ui = 'bdd', exit = false, ignore = [], file = [], recursive = false, sort = false, - spec = [] + spec = [], + watchFiles, + watchIgnore } = options; const fileCollectParams = { @@ -137,7 +138,7 @@ exports.runMocha = (mocha, options) => { }; if (watch) { - watchRun(mocha, {ui}, fileCollectParams); + watchRun(mocha, {watchFiles, watchIgnore}, fileCollectParams); } else { exports.singleRun(mocha, {exit}, fileCollectParams); } diff --git a/lib/cli/run-option-metadata.js b/lib/cli/run-option-metadata.js index d146ceeca9..d0bc92ffbe 100644 --- a/lib/cli/run-option-metadata.js +++ b/lib/cli/run-option-metadata.js @@ -18,9 +18,11 @@ exports.types = { 'file', 'global', 'ignore', - 'require', 'reporter-option', - 'spec' + 'require', + 'spec', + 'watch-files', + 'watch-ignore' ], boolean: [ 'allow-uncaught', @@ -68,7 +70,6 @@ exports.aliases = { 'async-only': ['A'], bail: ['b'], color: ['c', 'colors'], - extension: ['watch-extensions'], fgrep: ['f'], global: ['globals'], grep: ['g'], diff --git a/lib/cli/run.js b/lib/cli/run.js index 9adb602ca3..e4e6ba2791 100644 --- a/lib/cli/run.js +++ b/lib/cli/run.js @@ -88,7 +88,7 @@ exports.builder = yargs => extension: { default: defaults.extension, defaultDescription: 'js', - description: 'File extension(s) to load and/or watch', + description: 'File extension(s) to load', group: GROUPS.FILES, requiresArg: true, coerce: list @@ -241,6 +241,19 @@ exports.builder = yargs => watch: { description: 'Watch files in the current working directory for changes', group: GROUPS.FILES + }, + 'watch-files': { + description: 'List of paths or globs to watch', + group: GROUPS.FILES, + requiresArg: true, + coerce: list + }, + 'watch-ignore': { + description: 'List of paths or globs to exclude from watching', + group: GROUPS.FILES, + requiresArg: true, + coerce: list, + default: defaults['watch-ignore'] } }) .positional('spec', { diff --git a/lib/cli/watch-run.js b/lib/cli/watch-run.js index e7ef34c632..32728c1061 100644 --- a/lib/cli/watch-run.js +++ b/lib/cli/watch-run.js @@ -1,8 +1,8 @@ 'use strict'; -const utils = require('../utils'); +const path = require('path'); +const chokidar = require('chokidar'); const Context = require('../context'); -const Mocha = require('../mocha'); const collectFiles = require('./collect-files'); /** @@ -16,18 +16,51 @@ const collectFiles = require('./collect-files'); * Run Mocha in "watch" mode * @param {Mocha} mocha - Mocha instance * @param {Object} opts - Options - * @param {string} opts.ui - User interface + * @param {string[]} [opts.watchFiles] - List of paths and patterns to + * watch. If not provided all files with an extension included in + * `fileColletionParams.extension` are watched. See first argument of + * `chokidar.watch`. + * @param {string[]} opts.watchIgnore - List of paths and patterns to + * exclude from watching. See `ignored` option of `chokidar`. * @param {Object} fileCollectParams - Parameters that control test * file collection. See `lib/cli/collect-files.js`. - * @param {string[]} fileCollectParams.extension - List of extensions to watch + * @param {string[]} fileCollectParams.extension - List of extensions + * to watch if `opts.watchFiles` is not given. * @private */ -module.exports = (mocha, {ui}, fileCollectParams) => { - let runner; - const files = collectFiles(fileCollectParams); +module.exports = (mocha, {watchFiles, watchIgnore}, fileCollectParams) => { + if (!watchFiles) { + watchFiles = fileCollectParams.extension.reduce( + (watchFiles, ext) => watchFiles.concat([`**/*.${ext}`, `**/.*.${ext}`]), + [] + ); + } + + const watcher = chokidar.watch(watchFiles, { + ignored: watchIgnore, + ignoreInitial: true + }); + + const rerunner = createRerunner(mocha, () => { + getWatchedFiles(watcher).forEach(file => { + delete require.cache[file]; + }); + mocha.files = collectFiles(fileCollectParams); + }); + + watcher.on('ready', () => { + rerunner.run(); + }); + + watcher.on('all', () => { + rerunner.scheduleRun(); + }); console.log(); hideCursor(); + process.on('exit', () => { + showCursor(); + }); process.on('SIGINT', () => { showCursor(); console.log('\n'); @@ -35,17 +68,30 @@ module.exports = (mocha, {ui}, fileCollectParams) => { // killed by SIGINT which has portable number 2. process.exit(128 + 2); }); +}; + +/** + * Create an object that allows you to rerun tests on the mocha + * instance. `beforeRun` is called everytime before `mocha.run()` is + * called. + * + * @param {Mocha} mocha - Mocha instance + * @param {function} beforeRun - Called just before `mocha.run()` + */ +const createRerunner = (mocha, beforeRun) => { + // Set to a `Runner` when mocha is running. Set to `null` when mocha is not + // running. + let runner = null; - const watchFiles = utils.files(process.cwd(), fileCollectParams.extension); - let runAgain = false; + let rerunScheduled = false; - const loadAndRun = () => { + const run = () => { try { - mocha.files = files; - runAgain = false; + beforeRun(); + resetMocha(mocha); runner = mocha.run(() => { runner = null; - if (runAgain) { + if (rerunScheduled) { rerun(); } }); @@ -54,29 +100,62 @@ module.exports = (mocha, {ui}, fileCollectParams) => { } }; - const purge = () => { - watchFiles.forEach(Mocha.unloadFile); - }; - - loadAndRun(); - - const rerun = () => { - purge(); - eraseLine(); - mocha.suite = mocha.suite.clone(); - mocha.suite.ctx = new Context(); - mocha.ui(ui); - loadAndRun(); - }; + const scheduleRun = () => { + if (rerunScheduled) { + return; + } - utils.watch(watchFiles, () => { - runAgain = true; + rerunScheduled = true; if (runner) { runner.abort(); } else { rerun(); } + }; + + const rerun = () => { + rerunScheduled = false; + eraseLine(); + run(); + }; + + return { + scheduleRun, + run + }; +}; + +/** + * Return the list of absolute paths watched by a chokidar watcher. + * + * @param watcher - Instance of a chokidar watcher + * @return {string[]} - List of absolute paths + */ +const getWatchedFiles = watcher => { + const watchedDirs = watcher.getWatched(); + let watchedFiles = []; + Object.keys(watchedDirs).forEach(dir => { + watchedFiles = watchedFiles.concat( + watchedDirs[dir].map(file => path.join(dir, file)) + ); }); + return watchedFiles; +}; + +/** + * Reset the internal state of the mocha instance so that tests can be rerun. + * + * @param {Mocha} mocha - Mocha instance + * @private + */ +const resetMocha = mocha => { + mocha.unloadFiles(); + mocha.suite = mocha.suite.clone(); + mocha.suite.ctx = new Context(); + // Registers a callback on `mocha.suite` that wires new context to the DSL + // (e.g. `describe`) that is exposed as globals when the test files are + // reloaded. + mocha.ui(mocha.options.ui); }; /** diff --git a/lib/mocharc.json b/lib/mocharc.json index b0cd266714..e6f5d99c5b 100644 --- a/lib/mocharc.json +++ b/lib/mocharc.json @@ -6,5 +6,6 @@ "reporter": "spec", "slow": 75, "timeout": 2000, - "ui": "bdd" + "ui": "bdd", + "watch-ignore": ["node_modules", ".git"] } diff --git a/lib/utils.js b/lib/utils.js index 996e843507..805d98d463 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -53,80 +53,6 @@ exports.isString = function(obj) { return typeof obj === 'string'; }; -/** - * Watch the given `files` for changes - * and invoke `fn(file)` on modification. - * - * @private - * @param {Array} files - * @param {Function} fn - */ -exports.watch = function(files, fn) { - var options = {interval: 100}; - var debug = require('debug')('mocha:watch'); - files.forEach(function(file) { - debug('file %s', file); - fs.watchFile(file, options, function(curr, prev) { - if (prev.mtime < curr.mtime) { - fn(file); - } - }); - }); -}; - -/** - * Predicate to screen `pathname` for further consideration. - * - * @description - * Returns false for pathname referencing: - *
    - *
  • 'npm' package installation directory - *
  • 'git' version control directory - *
- * - * @private - * @param {string} pathname - File or directory name to screen - * @return {boolean} whether pathname should be further considered - * @example - * ['node_modules', 'test.js'].filter(considerFurther); // => ['test.js'] - */ -function considerFurther(pathname) { - var ignore = ['node_modules', '.git']; - - return !~ignore.indexOf(pathname); -} - -/** - * Lookup files in the given `dir`. - * - * @description - * Filenames are returned in _traversal_ order by the OS/filesystem. - * **Make no assumption that the names will be sorted in any fashion.** - * - * @private - * @param {string} dir - * @param {string[]} [exts=['js']] - * @param {Array} [ret=[]] - * @return {Array} - */ -exports.files = function(dir, exts, ret) { - ret = ret || []; - exts = exts || ['js']; - - fs.readdirSync(dir) - .filter(considerFurther) - .forEach(function(dirent) { - var pathname = path.join(dir, dirent); - if (fs.lstatSync(pathname).isDirectory()) { - exports.files(pathname, exts, ret); - } else if (hasMatchingExtname(pathname, exts)) { - ret.push(pathname); - } - }); - - return ret; -}; - /** * Compute a slug from the given `str`. * diff --git a/package-lock.json b/package-lock.json index cd6c298e00..ac164dbf11 100644 --- a/package-lock.json +++ b/package-lock.json @@ -729,7 +729,7 @@ "aproba": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha1-aALmJk79GMeQobDVF/DyYnvyyUo=", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true }, "arch": { @@ -823,7 +823,7 @@ }, "array-equal": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", + "resolved": "http://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", "dev": true }, @@ -1294,7 +1294,7 @@ }, "autolinker": { "version": "0.15.3", - "resolved": "https://registry.npmjs.org/autolinker/-/autolinker-0.15.3.tgz", + "resolved": "http://registry.npmjs.org/autolinker/-/autolinker-0.15.3.tgz", "integrity": "sha1-NCQX2PLzRhsUzwkIjV7fh5HcmDI=", "dev": true }, @@ -1774,7 +1774,7 @@ }, "bl": { "version": "1.2.2", - "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", + "resolved": "http://registry.npmjs.org/bl/-/bl-1.2.2.tgz", "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", "dev": true, "requires": { @@ -1797,7 +1797,7 @@ "bn.js": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha1-LN4J617jQfSEdGuwMJsyU7GxRC8=", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", "dev": true }, "body-parser": { @@ -2051,7 +2051,7 @@ "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha1-uqVZ7hTO1zRSIputcyZGfGH6vWA=" + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==" }, "browser-sync": { "version": "2.26.5", @@ -2103,6 +2103,26 @@ "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", "dev": true }, + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + } + }, "cliui": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", @@ -2140,6 +2160,15 @@ "number-is-nan": "^1.0.0" } }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, "lcid": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", @@ -2325,7 +2354,7 @@ }, "browserify-aes": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, "requires": { @@ -2379,7 +2408,7 @@ }, "browserify-rsa": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", "dev": true, "requires": { @@ -2662,7 +2691,7 @@ }, "camelcase-keys": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "resolved": "http://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", "dev": true, "requires": { @@ -2858,33 +2887,100 @@ "dev": true }, "chokidar": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.2.tgz", - "integrity": "sha512-IwXUx0FXc5ibYmPC2XeEj5mpXoV66sR+t3jqu2NS2GYwCktt3KF1/Qqjws/NkegajBA4RbZ5+DDwlOiJsxDHEg==", - "dev": true, - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "fsevents": "^1.2.7", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.0.2.tgz", + "integrity": "sha512-c4PR2egjNjI1um6bamCQ6bUNPDiyofNQruHvKgHQ4gDUP/ITSVSzNsiI5OWtHOsX323i5ha/kk4YmOZ1Ktg7KA==", + "requires": { + "anymatch": "^3.0.1", + "braces": "^3.0.2", + "fsevents": "^2.0.6", + "glob-parent": "^5.0.0", + "is-binary-path": "^2.1.0", + "is-glob": "^4.0.1", "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.0" + "readdirp": "^3.1.1" }, "dependencies": { + "anymatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.0.3.tgz", + "integrity": "sha512-c6IvoeBECQlMVuYUjSwimnhmztImpErfxJzWZhIQinIvQWoGOnB0dLIgifbPHQt5heS6mNlaZG16f06H3C8t1g==", + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "binary-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", + "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==" + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "requires": { + "fill-range": "^7.0.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "fsevents": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.0.7.tgz", + "integrity": "sha512-a7YT0SV3RB+DjYcppwVDLtn13UQnmg0SWZS7ezZD0UjnLwXmy8Zm21GMVGLaFGimIqcvyMQaOJBrop8MyOp1kQ==", + "optional": true + }, + "glob-parent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.0.0.tgz", + "integrity": "sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg==", + "requires": { + "is-glob": "^4.0.1" + } + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "requires": { + "binary-extensions": "^2.0.0" + } + }, "is-glob": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", - "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", - "dev": true, + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", "requires": { "is-extglob": "^2.1.1" } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "readdirp": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.1.2.tgz", + "integrity": "sha512-8rhl0xs2cxfVsqzreYCvs8EwBfn/DhVdqtoLmw19uI3SC5avYX9teCurlErfpPXGmYtMHReGaP2RsLnFvz/lnw==", + "requires": { + "picomatch": "^2.0.4" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + } } } }, @@ -2903,7 +2999,7 @@ "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha1-h2Dk7MJy9MNjUy+SbYdKriwTl94=", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", "dev": true, "requires": { "inherits": "^2.0.1", @@ -2992,7 +3088,7 @@ }, "slice-ansi": { "version": "0.0.4", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", + "resolved": "http://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", "dev": true }, @@ -3171,7 +3267,7 @@ "dependencies": { "convert-source-map": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "resolved": "http://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", "dev": true }, @@ -3487,7 +3583,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } @@ -3545,7 +3641,7 @@ }, "create-hash": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, "requires": { @@ -3558,7 +3654,7 @@ }, "create-hmac": { "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, "requires": { @@ -3573,7 +3669,7 @@ "createerror": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/createerror/-/createerror-1.3.0.tgz", - "integrity": "sha1-xma9TNa5TjVBU5ZWnUZJ3QzbMxM=", + "integrity": "sha512-w9UZUtkaGd8MfS7eMG7Sa0lV5vCJghqQfiOnwNVrPhbZScUp5h0jwYoAF933MKlotlG1JAJOCCT3xU6r+SDKNw==", "dev": true }, "cross-env": { @@ -3626,7 +3722,7 @@ }, "css-color-names": { "version": "0.0.4", - "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", + "resolved": "http://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", "integrity": "sha1-gIrcLnnPhHOAabZGyyDsJ762KeA=", "dev": true }, @@ -4250,7 +4346,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } @@ -4423,11 +4519,11 @@ "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha1-gAwN0eCov7yVg1wgKtIg/jF+WhI=" + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==" }, "diffie-hellman": { "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dev": true, "requires": { @@ -4597,7 +4693,7 @@ }, "duplexer": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "resolved": "http://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", "dev": true }, @@ -4890,7 +4986,7 @@ }, "es6-promisify": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "resolved": "http://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", "dev": true, "requires": { @@ -5076,7 +5172,7 @@ "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" @@ -5103,7 +5199,7 @@ "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" @@ -5149,7 +5245,7 @@ "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" @@ -5157,7 +5253,7 @@ }, "doctrine": { "version": "1.5.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "resolved": "http://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", "dev": true, "requires": { @@ -5412,7 +5508,7 @@ }, "event-stream": { "version": "3.3.4", - "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", + "resolved": "http://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", "dev": true, "requires": { @@ -5440,7 +5536,7 @@ "evp_bytestokey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha1-f8vbGY3HGVlDLv4ThCaE4FJaywI=", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "dev": true, "requires": { "md5.js": "^1.3.4", @@ -6291,7 +6387,7 @@ }, "fs-access": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz", + "resolved": "http://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz", "integrity": "sha1-1qh/JiJxzv6+wwxVNAf7mV2od3o=", "dev": true, "requires": { @@ -6897,7 +6993,7 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=" + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "functional-red-black-tree": { "version": "1.0.1", @@ -7142,7 +7238,7 @@ }, "debug": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "resolved": "http://registry.npmjs.org/debug/-/debug-2.2.0.tgz", "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", "dev": true, "requires": { @@ -7151,7 +7247,7 @@ }, "ms": { "version": "0.7.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "resolved": "http://registry.npmjs.org/ms/-/ms-0.7.1.tgz", "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", "dev": true } @@ -7504,7 +7600,7 @@ "html-encoding-sniffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", - "integrity": "sha1-5w2EuU2lOqN14R/jo1G+ZkLKRvg=", + "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", "dev": true, "requires": { "whatwg-encoding": "^1.0.1" @@ -7553,7 +7649,7 @@ }, "htmlescape": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", + "resolved": "http://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", "dev": true }, @@ -8501,8 +8597,7 @@ "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" }, "is-finite": { "version": "1.0.2", @@ -8592,7 +8687,7 @@ }, "is-obj": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "resolved": "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", "dev": true }, @@ -8652,7 +8747,7 @@ "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha1-LBY7P6+xtgbZ0Xko8FwqHDjgdnc=", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "requires": { "isobject": "^3.0.1" @@ -9320,6 +9415,35 @@ "useragent": "2.3.0" }, "dependencies": { + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + } + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, "mime": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.3.tgz", @@ -9369,7 +9493,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } @@ -10329,7 +10453,7 @@ }, "map-stream": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", + "resolved": "http://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=", "dev": true }, @@ -10509,7 +10633,7 @@ "markdown-toc": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/markdown-toc/-/markdown-toc-1.2.0.tgz", - "integrity": "sha1-RKFWBoREkDFK/ARESD+eexEiwzk=", + "integrity": "sha512-eOsq7EGd3asV0oBfmyqngeEIhrbkc7XVP63OwcJBIhH2EpG2PzFcbZdhy1jutXSlRBBVMNXHvMtSr5LAxSUvUg==", "dev": true, "requires": { "concat-stream": "^1.5.2", @@ -10559,7 +10683,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } @@ -10594,7 +10718,7 @@ "dependencies": { "commander": { "version": "2.9.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "resolved": "http://registry.npmjs.org/commander/-/commander-2.9.0.tgz", "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", "dev": true, "requires": { @@ -10705,7 +10829,7 @@ }, "media-typer": { "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "resolved": "http://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", "dev": true }, @@ -10732,7 +10856,7 @@ "dependencies": { "lru-cache": { "version": "2.5.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz", + "resolved": "http://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz", "integrity": "sha1-2COIrpyWC+y+oMc7uet5tsbOmus=", "dev": true } @@ -10767,7 +10891,7 @@ }, "meow": { "version": "3.7.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "resolved": "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz", "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", "dev": true, "requires": { @@ -10785,7 +10909,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } @@ -10830,7 +10954,7 @@ "miller-rabin": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha1-8IA1HIZbDcViqEYpZtqlNUPHik0=", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", "dev": true, "requires": { "bn.js": "^4.0.0", @@ -10892,7 +11016,7 @@ }, "minimist": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" }, "minipass": { @@ -10941,7 +11065,7 @@ "is-extendable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha1-p0cPnkJnM9gb2B4RVSZOOjUHyrQ=", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "dev": true, "requires": { "is-plain-object": "^2.0.4" @@ -10951,7 +11075,7 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "requires": { "minimist": "0.0.8" @@ -11150,7 +11274,7 @@ "no-case": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", - "integrity": "sha1-YLgTOWvjmz8SiKTB7V0efSi0ZKw=", + "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==", "dev": true, "requires": { "lower-case": "^1.1.1" @@ -11343,8 +11467,7 @@ "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" }, "normalize-range": { "version": "0.1.2", @@ -11430,7 +11553,7 @@ "npmlog": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha1-CKfyqL9zRgR3mp76StXMcXq7lUs=", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "dev": true, "requires": { "are-we-there-yet": "~1.1.2", @@ -11760,6 +11883,27 @@ "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", "dev": true }, + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "dev": true, + "optional": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + } + }, "cliui": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", @@ -11786,6 +11930,16 @@ "number-is-nan": "^1.0.0" } }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "optional": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, "lcid": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", @@ -11904,7 +12058,7 @@ }, "merge-source-map": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", + "resolved": false, "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", "dev": true, "requires": { @@ -12160,7 +12314,7 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, @@ -12183,7 +12337,7 @@ }, "os-tmpdir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, @@ -12479,7 +12633,7 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-is-inside": { @@ -12557,7 +12711,7 @@ }, "pause-stream": { "version": "0.0.11", - "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", + "resolved": "http://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", "dev": true, "requires": { @@ -12642,14 +12796,14 @@ }, "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", + "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", "dev": true, "requires": { "chalk": "^1.1.3", @@ -12684,9 +12838,14 @@ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "dev": true }, + "picomatch": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.0.7.tgz", + "integrity": "sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA==" + }, "pify": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true }, @@ -12930,7 +13089,7 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, "supports-color": { @@ -13300,7 +13459,7 @@ "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", - "integrity": "sha1-ut+hSX1GJE9jkPWLMZgw2RB4U8U=", + "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", "dev": true, "requires": { "chalk": "^1.1.3", @@ -13975,7 +14134,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } @@ -14043,7 +14202,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { @@ -14621,7 +14780,7 @@ }, "safe-regex": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, "requires": { @@ -14679,7 +14838,7 @@ "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha1-KBYjTiN4vdxOU1T6tcqold9xANk=", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true }, "saxes": { @@ -14732,7 +14891,7 @@ "dependencies": { "commander": { "version": "2.8.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz", + "resolved": "http://registry.npmjs.org/commander/-/commander-2.8.1.tgz", "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", "dev": true, "requires": { @@ -15006,7 +15165,7 @@ }, "sha.js": { "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { @@ -15041,7 +15200,7 @@ }, "shasum": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", + "resolved": "http://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", "integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=", "dev": true, "requires": { @@ -15667,7 +15826,7 @@ }, "split": { "version": "0.3.3", - "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", + "resolved": "http://registry.npmjs.org/split/-/split-0.3.3.tgz", "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", "dev": true, "requires": { @@ -15772,7 +15931,7 @@ }, "starts-with": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/starts-with/-/starts-with-1.0.2.tgz", + "resolved": "http://registry.npmjs.org/starts-with/-/starts-with-1.0.2.tgz", "integrity": "sha1-Fnk6cp2J1M89T7LtovkIrjV/GW8=", "dev": true }, @@ -15896,7 +16055,7 @@ }, "stream-combiner": { "version": "0.0.4", - "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", + "resolved": "http://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", "dev": true, "requires": { @@ -16106,7 +16265,7 @@ }, "strip-eof": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "resolved": "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, @@ -16189,7 +16348,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } @@ -16430,7 +16589,7 @@ "dependencies": { "bluebird": { "version": "2.9.34", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.9.34.tgz", + "resolved": "http://registry.npmjs.org/bluebird/-/bluebird-2.9.34.tgz", "integrity": "sha1-L3tOyAIWMoqf3evfacjUlC/v99g=", "dev": true }, @@ -16697,7 +16856,7 @@ }, "through": { "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, @@ -16784,7 +16943,7 @@ "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha1-bTQzWIl2jSGyvNoKonfO07G/rfk=", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, "requires": { "os-tmpdir": "~1.0.2" @@ -17456,9 +17615,9 @@ "dev": true }, "upath": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.0.tgz", - "integrity": "sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", + "integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==", "dev": true }, "update-notifier": { @@ -17739,6 +17898,35 @@ "xtend": "^4.0.0" }, "dependencies": { + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + } + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, "through2": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", @@ -17754,7 +17942,7 @@ "webidl-conversions": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha1-qFWYCx8LazWbodXZ+zmulB+qY60=", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", "dev": true }, "whatwg-encoding": { @@ -17877,7 +18065,7 @@ }, "wrap-ansi": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "dev": true, "requires": { diff --git a/package-scripts.js b/package-scripts.js index f4d1dc9845..6d9985b90d 100644 --- a/package-scripts.js +++ b/package-scripts.js @@ -23,7 +23,7 @@ function test(testName, mochaParams) { module.exports = { scripts: { build: { - script: `browserify -e browser-entry.js --plugin ./scripts/dedefine --ignore 'fs' --ignore 'glob' --ignore 'path' --ignore 'supports-color' -o mocha.js`, + script: `browserify -e browser-entry.js --plugin ./scripts/dedefine --ignore 'fs' --ignore 'glob' --ignore 'path' --ignore 'supports-color' --ignore chokidar -o mocha.js`, description: 'Build browser bundle' }, lint: { diff --git a/package.json b/package.json index f53ea0ba15..4a0ed10f11 100644 --- a/package.json +++ b/package.json @@ -514,6 +514,7 @@ "dependencies": { "ansi-colors": "3.2.3", "browser-stdout": "1.3.1", + "chokidar": "3.0.2", "debug": "3.2.6", "diff": "3.5.0", "escape-string-regexp": "1.0.5", @@ -618,7 +619,8 @@ "fs": false, "glob": false, "path": false, - "supports-color": false + "supports-color": false, + "chokidar": false }, "prettier": { "singleQuote": true, diff --git a/test/integration/file-utils.spec.js b/test/integration/file-utils.spec.js index ae97b996e2..0b5b2e92fe 100644 --- a/test/integration/file-utils.spec.js +++ b/test/integration/file-utils.spec.js @@ -116,30 +116,6 @@ describe('file utils', function() { }); }); - describe('.files', function() { - it('should return broken symlink file path', function() { - if (!symlinkSupported) { - return this.skip(); - } - expect( - utils.files(tmpDir, ['js']), - 'to contain', - tmpFile('mocha-utils-link.js'), - tmpFile('mocha-utils.js') - ).and('to have length', 2); - - expect(existsSync(tmpFile('mocha-utils-link.js')), 'to be', true); - - fs.renameSync(tmpFile('mocha-utils.js'), tmpFile('bob')); - - expect(existsSync(tmpFile('mocha-utils-link.js')), 'to be', false); - - expect(utils.files(tmpDir, ['js']), 'to equal', [ - tmpFile('mocha-utils-link.js') - ]); - }); - }); - afterEach(removeTempDir); function makeTempDir() { diff --git a/test/integration/options/watch.spec.js b/test/integration/options/watch.spec.js index 5d9fb2f26a..0843380990 100644 --- a/test/integration/options/watch.spec.js +++ b/test/integration/options/watch.spec.js @@ -31,7 +31,95 @@ describe('--watch', function() { }); }); - it('reruns test when file matching extension is touched', function() { + it('reruns test when file matching --watch-files changes', function() { + const testFile = path.join(this.tempDir, 'test.js'); + copyFixture('__default__', testFile); + + const watchedFile = path.join(this.tempDir, 'dir/file.xyz'); + touchFile(watchedFile); + + return runMochaWatch( + [testFile, '--watch-files', 'dir/*.xyz'], + this.tempDir, + () => { + touchFile(watchedFile); + } + ).then(results => { + expect(results.length, 'to equal', 2); + }); + }); + + it('reruns test when file matching --watch-files is added', function() { + const testFile = path.join(this.tempDir, 'test.js'); + copyFixture('__default__', testFile); + + const watchedFile = path.join(this.tempDir, 'lib/file.xyz'); + return runMochaWatch( + [testFile, '--watch-files', '**/*.xyz'], + this.tempDir, + () => { + touchFile(watchedFile); + } + ).then(results => { + expect(results, 'to have length', 2); + }); + }); + + it('reruns test when file matching --watch-files is removed', function() { + const testFile = path.join(this.tempDir, 'test.js'); + copyFixture('__default__', testFile); + + const watchedFile = path.join(this.tempDir, 'lib/file.xyz'); + touchFile(watchedFile); + + return runMochaWatch( + [testFile, '--watch-files', 'lib/**/*.xyz'], + this.tempDir, + () => { + fs.removeSync(watchedFile); + } + ).then(results => { + expect(results, 'to have length', 2); + }); + }); + + it('does not rerun test when file not matching --watch-files is changed', function() { + const testFile = path.join(this.tempDir, 'test.js'); + copyFixture('__default__', testFile); + + const watchedFile = path.join(this.tempDir, 'dir/file.js'); + touchFile(watchedFile); + + return runMochaWatch( + [testFile, '--watch-files', 'dir/*.xyz'], + this.tempDir, + () => { + touchFile(watchedFile); + } + ).then(results => { + expect(results.length, 'to equal', 1); + }); + }); + + it('picks up new test files when they are added', function() { + const testFile = path.join(this.tempDir, 'test/a.js'); + copyFixture('__default__', testFile); + + return runMochaWatch( + ['test/**/*.js', '--watch-files', 'test/**/*.js'], + this.tempDir, + () => { + const addedTestFile = path.join(this.tempDir, 'test/b.js'); + copyFixture('passing', addedTestFile); + } + ).then(results => { + expect(results, 'to have length', 2); + expect(results[0].passes, 'to have length', 1); + expect(results[1].passes, 'to have length', 3); + }); + }); + + it('reruns test when file matching --extension is changed', function() { const testFile = path.join(this.tempDir, 'test.js'); copyFixture('__default__', testFile); @@ -49,6 +137,24 @@ describe('--watch', function() { }); }); + it('reruns test when file starting with . and matching --extension is changed', function() { + const testFile = path.join(this.tempDir, 'test.js'); + copyFixture('__default__', testFile); + + const watchedFile = path.join(this.tempDir, '.file.xyz'); + touchFile(watchedFile); + + return runMochaWatch( + [testFile, '--extension', 'xyz,js'], + this.tempDir, + () => { + touchFile(watchedFile); + } + ).then(results => { + expect(results, 'to have length', 2); + }); + }); + it('ignores files in "node_modules" and ".git" by default', function() { const testFile = path.join(this.tempDir, 'test.js'); copyFixture('__default__', testFile); @@ -75,17 +181,45 @@ describe('--watch', function() { }); }); + it('ignores files matching --watch-ignore', function() { + const testFile = path.join(this.tempDir, 'test.js'); + copyFixture('__default__', testFile); + + const watchedFile = path.join(this.tempDir, 'dir/file-to-ignore.xyz'); + touchFile(watchedFile); + + return runMochaWatch( + [ + testFile, + '--watch-files', + 'dir/*.xyz', + '--watch-ignore', + 'dir/*ignore*' + ], + this.tempDir, + () => { + touchFile(watchedFile); + } + ).then(results => { + expect(results.length, 'to equal', 1); + }); + }); + it('reloads test files when they change', function() { const testFile = path.join(this.tempDir, 'test.js'); copyFixture('options/watch/test-file-change', testFile); - return runMochaWatch([testFile], this.tempDir, () => { - replaceFileContents( - testFile, - 'testShouldFail = true', - 'testShouldFail = false' - ); - }).then(results => { + return runMochaWatch( + [testFile, '--watch-files', '**/*.js'], + this.tempDir, + () => { + replaceFileContents( + testFile, + 'testShouldFail = true', + 'testShouldFail = false' + ); + } + ).then(results => { expect(results, 'to have length', 2); expect(results[0].passes, 'to have length', 0); expect(results[0].failures, 'to have length', 1); @@ -101,13 +235,17 @@ describe('--watch', function() { const dependency = path.join(this.tempDir, 'lib', 'dependency.js'); copyFixture('options/watch/dependency', dependency); - return runMochaWatch([testFile], this.tempDir, () => { - replaceFileContents( - dependency, - 'module.exports.testShouldFail = false', - 'module.exports.testShouldFail = true' - ); - }).then(results => { + return runMochaWatch( + [testFile, '--watch-files', 'lib/**/*.js'], + this.tempDir, + () => { + replaceFileContents( + dependency, + 'module.exports.testShouldFail = false', + 'module.exports.testShouldFail = true' + ); + } + ).then(results => { expect(results, 'to have length', 2); expect(results[0].passes, 'to have length', 1); expect(results[0].failures, 'to have length', 0); diff --git a/test/node-unit/cli/options.spec.js b/test/node-unit/cli/options.spec.js index 3c39cc7f09..84723bafda 100644 --- a/test/node-unit/cli/options.spec.js +++ b/test/node-unit/cli/options.spec.js @@ -28,8 +28,7 @@ const defaults = { timeouts: 1000, t: 1000, opts: '/default/path/to/mocha.opts', - extension: ['js'], - 'watch-extensions': ['js'] + extension: ['js'] }; describe('options', function() { From 6ec07d6d7f0cf5d76558fd64a6b70b2934148b58 Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Tue, 10 Sep 2019 14:38:55 -0700 Subject: [PATCH 014/396] add OpenJS Foundation logo to website (#4008) * add OpenJS Foundation logo to website * fix flaky template Signed-off-by: Christopher Hiller --- docs/_includes/default.html | 45 +++++++++++++++--------- docs/css/style.css | 19 ++++++---- docs/images/openjsf-logo.svg | 68 ++++++++++++++++++++++++++++++++++++ docs/index.md | 2 +- 4 files changed, 109 insertions(+), 25 deletions(-) create mode 100644 docs/images/openjsf-logo.svg diff --git a/docs/_includes/default.html b/docs/_includes/default.html index 0a2a60b11e..baf940c829 100644 --- a/docs/_includes/default.html +++ b/docs/_includes/default.html @@ -22,27 +22,36 @@

- +

simple, flexible, fun

{{ content }}
- - + +