test-exclude
Advanced tools
Comparing version 4.0.3 to 4.1.0
@@ -6,2 +6,13 @@ # Change Log | ||
<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> | ||
@@ -8,0 +19,0 @@ ## [4.0.3](https://github.com/istanbuljs/test-exclude/compare/test-exclude@4.0.2...test-exclude@4.0.3) (2017-03-21) |
16
index.js
@@ -12,2 +12,3 @@ const assign = require('object-assign') | ||
include: false, | ||
relativePath: true, | ||
configKey: null, // the key to load config from in package.json. | ||
@@ -59,9 +60,14 @@ configPath: null, // optionally override requireMainFilename. | ||
TestExclude.prototype.shouldInstrument = function (filename, relFile) { | ||
relFile = relFile || path.relative(this.cwd, filename) | ||
var pathToCheck = filename | ||
// Don't instrument files that are outside of the current working directory. | ||
if (/^\.\./.test(path.relative(this.cwd, filename))) return false | ||
if (this.relativePath) { | ||
relFile = relFile || path.relative(this.cwd, filename) | ||
relFile = relFile.replace(/^\.[\\/]/, '') // remove leading './' or '.\'. | ||
return (!this.include || micromatch.any(relFile, this.include, {dotfiles: true})) && !micromatch.any(relFile, this.exclude, {dotfiles: true}) | ||
// 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}) | ||
} | ||
@@ -68,0 +74,0 @@ |
{ | ||
"name": "test-exclude", | ||
"version": "4.0.3", | ||
"version": "4.1.0", | ||
"description": "test for inclusion or exclusion of paths using pkg-conf and globs", | ||
"main": "index.js", | ||
"files": [ | ||
"index.js" | ||
], | ||
"scripts": { | ||
@@ -7,0 +10,0 @@ "pretest": "standard", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12388
5
94
1