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

Remove excluded files from coverage before writing #649

Merged
merged 1 commit into from
Sep 5, 2017

Conversation

princjef
Copy link
Contributor

Fixes #581 by scrubbing the coverage object to remove any excluded files for which coverage was generated.

I'll admit to not being entirely sure how the coverage gets in for those files in the first place (the exclude logic appears to be running correctly in addAllFiles()), but this provides a catch-all at the end of processing to clean it up.

There's also a question about whether the scrub should occur before or after following source maps. Doing it before seems to make the most sense based on how things work now.

@princjef princjef changed the title fix: remove excluded files from coverage before writing Remove excluded files from coverage before writing Aug 18, 2017
@coveralls
Copy link

coveralls commented Aug 18, 2017

Coverage Status

Changes Unknown when pulling d7dcc74 on princjef:exclude-all-fix into ** on istanbuljs:master**.

@bcoe
Copy link
Member

bcoe commented Aug 22, 2017

@princjef very odd! seems like a reasonable safety to put in place though. I'll work on landing this as soon as possible.

Worth noting, I stood up a community slack for coordinating work on this project if you feel like helping coordinate work around getting another release of nyc out:

http://devtoolscommunity.herokuapp.com/

@bcoe
Copy link
Member

bcoe commented Sep 5, 2017

@princjef I've released this for you in the latest version of nyc, mind testing things out? thanks for the contribution 🎉

@Speedy37
Copy link
Contributor

Speedy37 commented Sep 6, 2017

This broke my builds, because I'm using NYC_CWD / --cwd to bypass /node_modules/ default exclusion in my tests base path, but I still want to exclude /node_modules/ after it

ie: I want /mybase_path/node_modules/mymodules/**
but not /mybase_path/node_modules/mymodules/node_modules/**

And this can't be expressed with -x -i even with -x "!/node_modules/" due to the way they are resolved

@Speedy37
Copy link
Contributor

Speedy37 commented Sep 6, 2017

I spoke to soon, it is commit dd40dc5 that broke my build

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

4 participants