This commit is contained in:
Stephen Franceschelli 2019-07-30 13:41:05 -04:00
parent 596a6da241
commit c1a589c5b6
7078 changed files with 1882834 additions and 319 deletions

292
node_modules/test-exclude/CHANGELOG.md generated vendored Normal file
View file

@ -0,0 +1,292 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [5.2.3](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@5.2.2...test-exclude@5.2.3) (2019-04-24)
**Note:** Version bump only for package test-exclude
## [5.2.2](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@5.2.1...test-exclude@5.2.2) (2019-04-09)
**Note:** Version bump only for package test-exclude
## [5.2.1](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@5.2.0...test-exclude@5.2.1) (2019-04-03)
### Bug Fixes
* Remove `**/node_modules/**` from defaultExclude. ([#351](https://github.com/istanbuljs/istanbuljs/issues/351)) ([deb3963](https://github.com/istanbuljs/istanbuljs/commit/deb3963)), closes [#347](https://github.com/istanbuljs/istanbuljs/issues/347)
# [5.2.0](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@5.1.0...test-exclude@5.2.0) (2019-03-12)
### Features
* Add TestExclude.globSync to find all files ([#309](https://github.com/istanbuljs/istanbuljs/issues/309)) ([2d7ea72](https://github.com/istanbuljs/istanbuljs/commit/2d7ea72))
* Support turning of node_modules default exclude via flag ([#213](https://github.com/istanbuljs/istanbuljs/issues/213)) ([9b4b34c](https://github.com/istanbuljs/istanbuljs/commit/9b4b34c))
# [5.1.0](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@5.0.1...test-exclude@5.1.0) (2019-01-26)
### Features
* Ignore babel.config.js. ([#279](https://github.com/istanbuljs/istanbuljs/issues/279)) ([24af6eb](https://github.com/istanbuljs/istanbuljs/commit/24af6eb))
<a name="5.0.1"></a>
## [5.0.1](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@5.0.0...test-exclude@5.0.1) (2018-12-25)
**Note:** Version bump only for package test-exclude
<a name="5.0.0"></a>
# [5.0.0](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@4.2.2...test-exclude@5.0.0) (2018-06-26)
* test-exclude: bump read-pkg-up dependency (#184) ([bb58139](https://github.com/istanbuljs/istanbuljs/commit/bb58139)), closes [#184](https://github.com/istanbuljs/istanbuljs/issues/184)
### BREAKING CHANGES
* Support for Node.js 4.x is dropped.
<a name="4.2.2"></a>
## [4.2.2](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@4.2.1...test-exclude@4.2.2) (2018-06-06)
**Note:** Version bump only for package test-exclude
<a name="4.2.1"></a>
## [4.2.1](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@4.2.0...test-exclude@4.2.1) (2018-03-04)
### Bug Fixes
* upgrade micromatch ([#142](https://github.com/istanbuljs/istanbuljs/issues/142)) ([24104a7](https://github.com/istanbuljs/istanbuljs/commit/24104a7))
<a name="4.2.0"></a>
# [4.2.0](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@4.1.1...test-exclude@4.2.0) (2018-02-13)
### Features
* add additional patterns to default excludes ([#133](https://github.com/istanbuljs/istanbuljs/issues/133)) ([4cedf63](https://github.com/istanbuljs/istanbuljs/commit/4cedf63))
<a name="4.1.1"></a>
## [4.1.1](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@4.1.0...test-exclude@4.1.1) (2017-05-27)
### Bug Fixes
* add more general support for negated exclude rules ([#58](https://github.com/istanbuljs/istanbuljs/issues/58)) ([08445db](https://github.com/istanbuljs/istanbuljs/commit/08445db))
<a name="4.1.0"></a>
# [4.1.0](https://github.com/istanbuljs/test-exclude/compare/test-exclude@4.0.3...test-exclude@4.1.0) (2017-04-29)
### Features
* add possibility to filter coverage maps when running reports post-hoc ([#24](https://github.com/istanbuljs/istanbuljs/issues/24)) ([e1c99d6](https://github.com/istanbuljs/test-exclude/commit/e1c99d6))
<a name="4.0.3"></a>
## [4.0.3](https://github.com/istanbuljs/test-exclude/compare/test-exclude@4.0.2...test-exclude@4.0.3) (2017-03-21)
<a name="4.0.2"></a>
## [4.0.2](https://github.com/istanbuljs/test-exclude/compare/test-exclude@4.0.0...test-exclude@4.0.2) (2017-03-21)
<a name="4.0.0"></a>
# [4.0.0](https://github.com/istanbuljs/test-exclude/compare/v3.3.0...v4.0.0) (2017-01-19)
### Features
* add coverage to default excludes ([#23](https://github.com/istanbuljs/test-exclude/issues/23)) ([59e8bbf](https://github.com/istanbuljs/test-exclude/commit/59e8bbf))
### BREAKING CHANGES
* additional coverage folder is now excluded
<a name="3.3.0"></a>
# [3.3.0](https://github.com/istanbuljs/test-exclude/compare/v3.2.2...v3.3.0) (2016-11-22)
### Features
* allow include/exclude rules to be a string rather than array ([#22](https://github.com/istanbuljs/test-exclude/issues/22)) ([f8f99c6](https://github.com/istanbuljs/test-exclude/commit/f8f99c6))
<a name="3.2.2"></a>
## [3.2.2](https://github.com/istanbuljs/test-exclude/compare/v3.2.1...v3.2.2) (2016-11-14)
### Bug Fixes
* we no longer need to add node_modules/** rule ([d0cfbc3](https://github.com/istanbuljs/test-exclude/commit/d0cfbc3))
<a name="3.2.1"></a>
## [3.2.1](https://github.com/istanbuljs/test-exclude/compare/v3.2.0...v3.2.1) (2016-11-14)
### Bug Fixes
* fix bug matching files in root, introduced by dotfiles setting ([27b249c](https://github.com/istanbuljs/test-exclude/commit/27b249c))
<a name="3.2.0"></a>
# [3.2.0](https://github.com/istanbuljs/test-exclude/compare/v3.1.0...v3.2.0) (2016-11-14)
### Features
* adds *.test.*.js exclude rule ([#20](https://github.com/istanbuljs/test-exclude/issues/20)) ([34f5cba](https://github.com/istanbuljs/test-exclude/commit/34f5cba))
<a name="3.1.0"></a>
# [3.1.0](https://github.com/istanbuljs/test-exclude/compare/v3.0.0...v3.1.0) (2016-11-14)
### Features
* we now support dot folders ([f2c1598](https://github.com/istanbuljs/test-exclude/commit/f2c1598))
<a name="3.0.0"></a>
# [3.0.0](https://github.com/istanbuljs/test-exclude/compare/v2.1.3...v3.0.0) (2016-11-13)
### Features
* always exclude node_modules ([#18](https://github.com/istanbuljs/test-exclude/issues/18)) ([b86d144](https://github.com/istanbuljs/test-exclude/commit/b86d144))
### BREAKING CHANGES
* `**/node_modules/**` is again added by default, but can be counteracted with `!**/node_modules/**`.
<a name="2.1.3"></a>
## [2.1.3](https://github.com/istanbuljs/test-exclude/compare/v2.1.2...v2.1.3) (2016-09-30)
### Bug Fixes
* switch lodash.assign to object-assign ([#16](https://github.com/istanbuljs/test-exclude/issues/16)) ([45a5488](https://github.com/istanbuljs/test-exclude/commit/45a5488))
<a name="2.1.2"></a>
## [2.1.2](https://github.com/istanbuljs/test-exclude/compare/v2.1.1...v2.1.2) (2016-08-31)
### Bug Fixes
* **exclude-config:** Use the defaultExcludes for anything passed in that is not an array ([#15](https://github.com/istanbuljs/test-exclude/issues/15)) ([227042f](https://github.com/istanbuljs/test-exclude/commit/227042f))
<a name="2.1.1"></a>
# [2.1.1](https://github.com/istanbuljs/test-exclude/compare/v2.1.0...v2.1.1) (2016-08-12)
### Bug Fixes
* it should be possible to cover the node_modules folder ([#13](https://github.com/istanbuljs/test-exclude/issues/13)) ([09f2788](https://github.com/istanbuljs/test-exclude/commit/09f2788))
<a name="2.1.0"></a>
# [2.1.0](https://github.com/istanbuljs/test-exclude/compare/v2.0.0...v2.1.0) (2016-08-12)
### Features
* export defaultExclude, so that it can be used in yargs' default settings ([#12](https://github.com/istanbuljs/test-exclude/issues/12)) ([5b3743b](https://github.com/istanbuljs/test-exclude/commit/5b3743b))
<a name="2.0.0"></a>
# [2.0.0](https://github.com/istanbuljs/test-exclude/compare/v1.1.0...v2.0.0) (2016-08-12)
### Bug Fixes
* use Array#reduce and remove unneeded branch in prepGlobPatterns ([#5](https://github.com/istanbuljs/test-exclude/issues/5)) ([c0f0f59](https://github.com/istanbuljs/test-exclude/commit/c0f0f59))
### Features
* don't exclude anything when empty array passed ([#11](https://github.com/istanbuljs/test-exclude/issues/11)) ([200ec07](https://github.com/istanbuljs/test-exclude/commit/200ec07))
### BREAKING CHANGES
* we now allow an empty array to be passed in, making it possible to disable the default exclude rules -- we will need to be mindful when pulling this logic into nyc.
<a name="1.1.0"></a>
# [1.1.0](https://github.com/bcoe/test-exclude/compare/v1.0.0...v1.1.0) (2016-06-08)
### Features
* set configFound if we find a configuration key in package.json ([#2](https://github.com/bcoe/test-exclude/issues/2)) ([64da7b9](https://github.com/bcoe/test-exclude/commit/64da7b9))
<a name="1.0.0"></a>
# 1.0.0 (2016-06-06)
### Features
* initial commit, pulled over some of the functionality from nyc ([3f1fce3](https://github.com/bcoe/test-exclude/commit/3f1fce3))
* you can now load include/exclude logic from a package.json stanza ([#1](https://github.com/bcoe/test-exclude/issues/1)) ([29b543d](https://github.com/bcoe/test-exclude/commit/29b543d))

14
node_modules/test-exclude/LICENSE.txt generated vendored Normal file
View file

@ -0,0 +1,14 @@
Copyright (c) 2016, Contributors
Permission to use, copy, modify, and/or distribute this software
for any purpose with or without fee is hereby granted, provided
that the above copyright notice and this permission notice
appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

56
node_modules/test-exclude/README.md generated vendored Normal file
View file

@ -0,0 +1,56 @@
# test-exclude
The file include/exclude logic used by [nyc](https://github.com/istanbuljs/nyc).
[![Build Status](https://travis-ci.org/istanbuljs/test-exclude.svg)](https://travis-ci.org/istanbuljs/test-exclude)
[![Coverage Status](https://coveralls.io/repos/github/istanbuljs/test-exclude/badge.svg?branch=master)](https://coveralls.io/github/istanbuljs/test-exclude?branch=master)
[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version)
[![Greenkeeper badge](https://badges.greenkeeper.io/istanbuljs/test-exclude.svg)](https://greenkeeper.io/)
## Usage
```js
const exclude = require('test-exclude');
if (exclude().shouldInstrument('./foo.js')) {
// let's instrument this file for test coverage!
}
```
_you can load configuration from a key in package.json:_
_package.json_
```json
{
"name": "awesome-module",
"test": {
"include": ["**/index.js"]
}
}
```
_app.js_
```js
const exclude = require('test-exclude');
if (exclude({ configKey: 'test' }).shouldInstrument('./index.js')) {
// let's instrument this file for test coverage!
}
```
## Including node_modules folder
by default the `node_modules` folder is added to all groups of
exclude rules. In the rare case that you wish to instrument files
stored in `node_modules`, a negative glob can be used:
```js
const exclude = require('test-exclude');
const e = exclude({
exclude: ['!**/node_modules/**']
});
```
## License
ISC

186
node_modules/test-exclude/index.js generated vendored Normal file
View file

@ -0,0 +1,186 @@
const path = require('path');
const glob = require('glob');
const minimatch = require('minimatch');
const readPkgUp = require('read-pkg-up');
const requireMainFilename = require('require-main-filename');
class TestExclude {
constructor(opts) {
Object.assign(
this,
{
cwd: process.cwd(),
include: false,
relativePath: true,
configKey: null, // the key to load config from in package.json.
configPath: null, // optionally override requireMainFilename.
configFound: false,
excludeNodeModules: true,
extension: false
},
opts
);
if (typeof this.include === 'string') {
this.include = [this.include];
}
if (typeof this.exclude === 'string') {
this.exclude = [this.exclude];
}
if (typeof this.extension === 'string') {
this.extension = [this.extension];
} else if (
!Array.isArray(this.extension) ||
this.extension.length === 0
) {
this.extension = false;
}
if (!this.include && !this.exclude && this.configKey) {
Object.assign(this, this.pkgConf(this.configKey, this.configPath));
}
if (!this.exclude || !Array.isArray(this.exclude)) {
this.exclude = exportFunc.defaultExclude;
}
if (this.include && this.include.length > 0) {
this.include = prepGlobPatterns([].concat(this.include));
} else {
this.include = false;
}
if (
this.excludeNodeModules &&
!this.exclude.includes('**/node_modules/**')
) {
this.exclude = this.exclude.concat('**/node_modules/**');
}
this.exclude = prepGlobPatterns([].concat(this.exclude));
this.handleNegation();
}
/* handle the special case of negative globs
* (!**foo/bar); we create a new this.excludeNegated set
* of rules, which is applied after excludes and we
* move excluded include rules into this.excludes.
*/
handleNegation() {
const noNeg = e => e.charAt(0) !== '!';
const onlyNeg = e => e.charAt(0) === '!';
const stripNeg = e => e.slice(1);
if (Array.isArray(this.include)) {
const includeNegated = this.include.filter(onlyNeg).map(stripNeg);
this.exclude.push(...prepGlobPatterns(includeNegated));
this.include = this.include.filter(noNeg);
}
this.excludeNegated = this.exclude.filter(onlyNeg).map(stripNeg);
this.exclude = this.exclude.filter(noNeg);
this.excludeNegated = prepGlobPatterns(this.excludeNegated);
}
shouldInstrument(filename, relFile) {
if (
this.extension &&
!this.extension.some(ext => filename.endsWith(ext))
) {
return false;
}
let pathToCheck = filename;
if (this.relativePath) {
relFile = relFile || path.relative(this.cwd, filename);
// Don't instrument files that are outside of the current working directory.
if (/^\.\./.test(path.relative(this.cwd, filename))) {
return false;
}
pathToCheck = relFile.replace(/^\.[\\/]/, ''); // remove leading './' or '.\'.
}
const dot = { dot: true };
const matches = pattern => minimatch(pathToCheck, pattern, dot);
return (
(!this.include || this.include.some(matches)) &&
(!this.exclude.some(matches) || this.excludeNegated.some(matches))
);
}
pkgConf(key, path) {
const cwd = path || requireMainFilename(require);
const obj = readPkgUp.sync({ cwd });
if (obj.pkg && obj.pkg[key] && typeof obj.pkg[key] === 'object') {
this.configFound = true;
return obj.pkg[key];
}
return {};
}
globSync(cwd = this.cwd) {
const globPatterns = getExtensionPattern(this.extension || []);
const globOptions = { cwd, nodir: true, dot: true };
/* If we don't have any excludeNegated then we can optimize glob by telling
* it to not iterate into unwanted directory trees (like node_modules). */
if (this.excludeNegated.length === 0) {
globOptions.ignore = this.exclude;
}
return glob
.sync(globPatterns, globOptions)
.filter(file => this.shouldInstrument(path.resolve(cwd, file)));
}
}
function prepGlobPatterns(patterns) {
return patterns.reduce((result, pattern) => {
// Allow gitignore style of directory exclusion
if (!/\/\*\*$/.test(pattern)) {
result = result.concat(pattern.replace(/\/$/, '') + '/**');
}
// Any rules of the form **/foo.js, should also match foo.js.
if (/^\*\*\//.test(pattern)) {
result = result.concat(pattern.replace(/^\*\*\//, ''));
}
return result.concat(pattern);
}, []);
}
function getExtensionPattern(extension) {
switch (extension.length) {
case 0:
return '**';
case 1:
return `**/*${extension[0]}`;
default:
return `**/*{${extension.join()}}`;
}
}
const exportFunc = opts => new TestExclude(opts);
const devConfigs = ['ava', 'babel', 'jest', 'nyc', 'rollup', 'webpack'];
exportFunc.defaultExclude = [
'coverage/**',
'packages/*/test/**',
'test/**',
'test{,-*}.js',
'**/*{.,-}test.js',
'**/__tests__/**',
`**/{${devConfigs.join()}}.config.js`
];
module.exports = exportFunc;

67
node_modules/test-exclude/package.json generated vendored Normal file
View file

@ -0,0 +1,67 @@
{
"_from": "test-exclude@^5.2.3",
"_id": "test-exclude@5.2.3",
"_inBundle": false,
"_integrity": "sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==",
"_location": "/test-exclude",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "test-exclude@^5.2.3",
"name": "test-exclude",
"escapedName": "test-exclude",
"rawSpec": "^5.2.3",
"saveSpec": null,
"fetchSpec": "^5.2.3"
},
"_requiredBy": [
"/babel-plugin-istanbul"
],
"_resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz",
"_shasum": "c3d3e1e311eb7ee405e092dac10aefd09091eac0",
"_spec": "test-exclude@^5.2.3",
"_where": "E:\\github\\setup-java\\node_modules\\babel-plugin-istanbul",
"author": {
"name": "Ben Coe",
"email": "ben@npmjs.com"
},
"bugs": {
"url": "https://github.com/istanbuljs/istanbuljs/issues"
},
"bundleDependencies": false,
"dependencies": {
"glob": "^7.1.3",
"minimatch": "^3.0.4",
"read-pkg-up": "^4.0.0",
"require-main-filename": "^2.0.0"
},
"deprecated": false,
"description": "test for inclusion or exclusion of paths using pkg-conf and globs",
"engines": {
"node": ">=6"
},
"files": [
"index.js"
],
"gitHead": "90e60cc47833bb780680f916488ca24f0be36ca2",
"homepage": "https://istanbul.js.org/",
"keywords": [
"exclude",
"include",
"glob",
"package",
"config"
],
"license": "ISC",
"main": "index.js",
"name": "test-exclude",
"repository": {
"type": "git",
"url": "git+https://github.com/istanbuljs/istanbuljs.git"
},
"scripts": {
"test": "mocha"
},
"version": "5.2.3"
}