diff options
Diffstat (limited to 'node_modules/test-exclude')
-rw-r--r-- | node_modules/test-exclude/CHANGELOG.md | 226 | ||||
-rw-r--r-- | node_modules/test-exclude/LICENSE.txt | 14 | ||||
-rw-r--r-- | node_modules/test-exclude/README.md | 56 | ||||
-rw-r--r-- | node_modules/test-exclude/index.js | 136 | ||||
-rw-r--r-- | node_modules/test-exclude/package.json | 47 |
5 files changed, 0 insertions, 479 deletions
diff --git a/node_modules/test-exclude/CHANGELOG.md b/node_modules/test-exclude/CHANGELOG.md deleted file mode 100644 index d111997d5..000000000 --- a/node_modules/test-exclude/CHANGELOG.md +++ /dev/null @@ -1,226 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -<a name="4.2.3"></a> -## [4.2.3](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@4.2.0...test-exclude@4.2.3) (2018-09-05) - - -### Bug Fixes - -* Tweak package.json files for republish as latest 1.x. ([#217](https://github.com/istanbuljs/istanbuljs/issues/217)) ([420481d](https://github.com/istanbuljs/istanbuljs/commit/420481d)), closes [#216](https://github.com/istanbuljs/istanbuljs/issues/216) - - -### BREAKING CHANGES - -* leaked into 1.x modules but it was thought they were -never released to latest. Apparently releasing 2.x to latest makes -those unwanted versions of 1.x available. - -This patch sets all modules to the latest 1.x version (4.x for -test-exclude). This will allow a new release to be made to revert -release of the breaking changes. - -Stop upgrading npm to latest for testing as it's not compatible with -node 4.x. - - - - -<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)) diff --git a/node_modules/test-exclude/LICENSE.txt b/node_modules/test-exclude/LICENSE.txt deleted file mode 100644 index 836440bef..000000000 --- a/node_modules/test-exclude/LICENSE.txt +++ /dev/null @@ -1,14 +0,0 @@ -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. diff --git a/node_modules/test-exclude/README.md b/node_modules/test-exclude/README.md deleted file mode 100644 index fd844f820..000000000 --- a/node_modules/test-exclude/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# test-exclude - -The file include/exclude logic used by [nyc](https://github.com/istanbuljs/nyc). - -[](https://travis-ci.org/istanbuljs/test-exclude) -[](https://coveralls.io/github/istanbuljs/test-exclude?branch=master) -[](https://github.com/conventional-changelog/standard-version) -[](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 diff --git a/node_modules/test-exclude/index.js b/node_modules/test-exclude/index.js deleted file mode 100644 index 8450491be..000000000 --- a/node_modules/test-exclude/index.js +++ /dev/null @@ -1,136 +0,0 @@ -const assign = require('object-assign') -const arrify = require('arrify') -const micromatch = require('micromatch') -const path = require('path') -const readPkgUp = require('read-pkg-up') -const requireMainFilename = require('require-main-filename') - -function TestExclude (opts) { - 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 - }, opts) - - if (typeof this.include === 'string') this.include = [this.include] - if (typeof this.exclude === 'string') this.exclude = [this.exclude] - - if (!this.include && !this.exclude && this.configKey) { - 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(arrify(this.include)) - } else { - this.include = false - } - - if (this.exclude.indexOf('**/node_modules/**') === -1) { - this.exclude.push('**/node_modules/**') - } - - this.exclude = prepGlobPatterns( - [].concat(arrify(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. -TestExclude.prototype.handleNegation = function () { - if (Array.isArray(this.include)) { - const includeNegated = this.include.filter(function (e) { - return e.charAt(0) === '!' - }).map(function (e) { - return e.slice(1) - }) - this.exclude.push.apply(this.exclude, prepGlobPatterns(includeNegated)) - this.include = this.include.filter(function (e) { - return e.charAt(0) !== '!' - }) - } - - this.excludeNegated = this.exclude.filter(function (e) { - return e.charAt(0) === '!' - }).map(function (e) { - return e.slice(1) - }) - this.exclude = this.exclude.filter(function (e) { - return e.charAt(0) !== '!' - }) - this.excludeNegated = prepGlobPatterns(this.excludeNegated) -} - -TestExclude.prototype.shouldInstrument = function (filename, relFile) { - var 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 '.\'. - } - - return ( - !this.include || - micromatch.any(pathToCheck, this.include, {dotfiles: true})) && - (!micromatch.any(pathToCheck, this.exclude, {dotfiles: true}) || - micromatch.any(pathToCheck, this.excludeNegated, {dotfiles: true})) -} - -TestExclude.prototype.pkgConf = function (key, path) { - const obj = readPkgUp.sync({ - cwd: path || requireMainFilename(require) - }) - - if (obj.pkg && obj.pkg[key] && typeof obj.pkg[key] === 'object') { - this.configFound = true - return obj.pkg[key] - } else { - return {} - } -} - -function prepGlobPatterns (patterns) { - return patterns.reduce(function (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) - }, []) -} - -var exportFunc = function (opts) { - return new TestExclude(opts) -} - -exportFunc.defaultExclude = [ - 'coverage/**', - 'packages/*/test/**', - 'test/**', - 'test{,-*}.js', - '**/*{.,-}test.js', - '**/__tests__/**', - '**/node_modules/**' -] - -module.exports = exportFunc diff --git a/node_modules/test-exclude/package.json b/node_modules/test-exclude/package.json deleted file mode 100644 index 526c3fa81..000000000 --- a/node_modules/test-exclude/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "test-exclude", - "version": "4.2.3", - "description": "test for inclusion or exclusion of paths using pkg-conf and globs", - "main": "index.js", - "files": [ - "index.js" - ], - "scripts": { - "pretest": "standard", - "test": "mocha" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/istanbuljs/istanbuljs.git" - }, - "keywords": [ - "exclude", - "include", - "glob", - "package", - "config" - ], - "author": "Ben Coe <ben@npmjs.com>", - "license": "ISC", - "bugs": { - "url": "https://github.com/istanbuljs/istanbuljs/issues" - }, - "homepage": "https://github.com/istanbuljs/istanbuljs#readme", - "devDependencies": { - "chai": "^3.5.0", - "mocha": "^3.1.2", - "standard": "^9.0.0" - }, - "dependencies": { - "arrify": "^1.0.1", - "micromatch": "^2.3.11", - "object-assign": "^4.1.0", - "read-pkg-up": "^1.0.1", - "require-main-filename": "^1.0.1" - }, - "greenkeeper": { - "ignore": [ - "read-pkg-up" - ] - } -} |