-
-
Notifications
You must be signed in to change notification settings - Fork 360
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
feat: Fix excludeAfterRemap functionality. #1010
feat: Fix excludeAfterRemap functionality. #1010
Conversation
@coreyfarrell see my comments here; do we just bite the bullet and move away from the |
…ion (istanbuljs#982)" This reverts commit 509c6aa.
Previously excludeAfterRemap caused filtering to happen before remapping to original source filenames. This caused the filtering to be completely ineffective. Fix the order, add a test to verify functionality.
ea4c1ef
to
220f77d
Compare
}) | ||
.option('include', { | ||
alias: 'n', | ||
default: [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coreyfarrell sorry for the post-review - shouldn't this be ['**']
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. An empty list is functionally equal to ['**']
but []
actually bypasses the check so it's more efficient.
https://github.com/istanbuljs/istanbuljs/blob/master/packages/test-exclude/index.js#L50-L54 is where the default is processed, []
is replaced with false
which short-circuits the include check.
I'm not sure if this qualifies as a feature or a fix, filtering after remapping has never worked. Original implementation of filtering remapped sources at dd40dc5, addition of excludeAfterRemap option at cdfdff3. Unfortunately the filtering step was done before coverage was remapped using source-maps, so it didn't do anything.
This is a potentially breaking change - bundled / compiled code was never filtered based on the original source filename, after this it will be. As an auxiliary change
test-exclude
options are also added to thenyc report
andnyc check-coverage
as those commands should process exclude-after-remap.Fixes #956