Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove **/node_modules/** from defaultExclude. #351

Merged
merged 1 commit into from Apr 3, 2019
Merged

fix: Remove **/node_modules/** from defaultExclude. #351

merged 1 commit into from Apr 3, 2019

Conversation

coreyfarrell
Copy link
Member

This is appended to the exclude list unless excludeNodeModules is
disabled. Removing from the default list makes it easier to use
excludeNodeModules as you no longer need to reset the exclude array to
get coverage of node_modules.

Fixes #347

This is appended to the `exclude` list unless excludeNodeModules is
disabled.  Removing from the default list makes it easier to use
excludeNodeModules as you no longer need to reset the `exclude` array to
get coverage of node_modules.

Fixes #347
@@ -57,7 +57,7 @@ class TestExclude {
this.excludeNodeModules &&
!this.exclude.includes('**/node_modules/**')
) {
this.exclude.push('**/node_modules/**');
this.exclude = this.exclude.concat('**/node_modules/**');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may appear unrelated but now this.exclude === exportFunc.defaultExclude which does not contain **/node_modules/** so without this shallow copy we would append the default list (this was caught by the tests). Previously we were appending any opts.exclude that did not include **/node_modules/**, though that was unlikely to cause any real problem.

@coreyfarrell
Copy link
Member Author

CC @hershmire just so you know.

Copy link
Member

@bcoe bcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good to me, I'm assuming that excludeNodeModules defaults to true, and will have added node_modules before any globs happen?

@coreyfarrell
Copy link
Member Author

Yes excludeNodeModules is true by default and is processed during the TestExclude constructor.

@coreyfarrell coreyfarrell merged commit deb3963 into istanbuljs:master Apr 3, 2019
@coreyfarrell coreyfarrell deleted the excludeNodeModules branch April 3, 2019 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants