-
-
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
Empty coverage output #157
Comments
Try this:
This issue should really be raised with tap, since you aren't using nyc directly. |
@jamestalmage actually the
that's why I posted here, it gives the same output as before. I think the problem is somehow related to the |
Rather than require('fake') I would try require('../) to require the index file. |
@micnic did you get a chance to give this a shot? |
@bcoe yes, I did the change, did not help, the same output, I also tried to run my test using |
This is correct, see https://github.com/bcoe/nyc/#excluding-files, but I think there's a bug. This is supposed to exclude any dependencies from the coverage report. However if you are testing a dependency its working directory would naturally be inside a I think behavior should be like this:
|
Files outside of the current working directory (meaning higher up in the file hierarchy) should not be instrumented. Fixes istanbuljs#157 where nyc is run from inside a node_modules directory. Fixes istanbuljs#154 where 'npm link' is used to fulfill dependencies. This removes matching the include/exclude patterns to the absolute filename, the patterns are now applied only to the relative portion within the current working directory. addAllFiles() has been changed to explicitly add files in the current working directory only.
Files outside of the current working directory (meaning higher up in the file hierarchy) should not be instrumented. Fixes istanbuljs#157 where nyc is run from inside a node_modules directory. Fixes istanbuljs#154 where 'npm link' is used to fulfill dependencies. This removes matching the include/exclude patterns to the absolute filename, the patterns are now applied only to the relative portion within the current working directory. addAllFiles() has been changed to explicitly add files in the current working directory only.
@novemberborn it worked for the fake module, will try a more complex module and will write you when it is ready |
good news, the tests for the real module have the expected output (with about 28 files). |
Files outside of the current working directory (meaning higher up in the file hierarchy) should not be instrumented. Fixes istanbuljs#157 where nyc is run from inside a node_modules directory. Fixes istanbuljs#154 where 'npm link' is used to fulfill dependencies. This removes matching the include/exclude patterns to the absolute filename, the patterns are now applied only to the relative portion within the current working directory. addAllFiles() has been changed to explicitly add files in the current working directory only.
@micnic could you please try this:
I'll publish this version to |
@bcoe |
Files outside of the current working directory (meaning higher up in the file hierarchy) should not be instrumented. Fixes istanbuljs#157 where nyc is run from inside a node_modules directory. Fixes istanbuljs#154 where 'npm link' is used to fulfill dependencies. This removes matching the include/exclude patterns to the absolute filename, the patterns are now applied only to the relative portion within the current working directory. addAllFiles() has been changed to explicitly add files in the current working directory only.
I created a fake module https://gist.github.com/micnic/f815c0bee18e99805318 and added a test for it, I am using
tap
which usesnyc
for code coverage. As you can see, If I do not add any additional argument I get an empty output, in case I add--all
argument the output adds theindex.js
file but it has 0% coverage which is false as the exported function was executed inside the test file.Does
nyc
avoid somehow myindex.js
file or it is required in the waynyc
does not expect the file to be required or I am missing something?The text was updated successfully, but these errors were encountered: