Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: add
include
andexclude
options to instrument command #1007feat: add
include
andexclude
options to instrument command #1007Changes from 6 commits
d576e44
39db2cc
880ccde
5f76838
5174d12
bd25a38
02bc210
b2eb670
995aa1a
5a28941
d22c585
fd69f9a
1fbc204
e1a1b94
17e4736
6852bbf
8903365
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
With the current nyc if I just did the following:
This resulted in
tmp/bin/nyc.js
containing the instrumented script withchmod a+x
. In theoryfs.copySync
should copy the chmod flags from input to output. I'd like to see a test to verify this (probably have to skip that test for Windows).Oddly enough I also tried:
This resulted in creation of
tmp/nyc.js
andtmp/wrap.js
, though I expected it to createtmp/bin/*.js
. Probably deal with this inconsistency in a follow-up.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.
A potential issue with this approach:
nyc instrument --delete . self-coverage
This would result in copying the entire project into
./self-coverage
, which would be correct. The issue is thatthis.walkAllFiles
happens after these files are created. I think we need to stop usingthis.walkAllFiles
, instead perform:This way
testExclude.globSync
is run before we create any files. I know this shouldn't matter as someone following the above example should addself-coverage
to the exclude list, but I think it will turn into an issue.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.
Good point,
fs-extra.copySync
currently prevents this from happening as it won't let you copy.
into./dest
. It seems a more custom solution withoutfs-extra.copySync
may be a better approach.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.
One other though, should the copy skip the
.git/
folder?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.
Most likely, I can't think of a use case where you'd need to copy the
.git/
folder from.
to./dest
while instrumenting files.Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.