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

Covers npm linked modules. #154

Closed
jamestalmage opened this issue Jan 26, 2016 · 4 comments
Closed

Covers npm linked modules. #154

jamestalmage opened this issue Jan 26, 2016 · 4 comments

Comments

@jamestalmage
Copy link
Member

If I use npm link and then run a test suite using NYC, the linked module ends up generating coverage info. I'm guessing because there is no node_modules folder in the parent path for linked modules (at least when using nvm).

@novemberborn
Copy link
Contributor

Could maybe exclude paths that go above the current directory?

@sindresorhus
Copy link
Member

I've noticed this too. I npm link a lot and it really makes for a noisy coverage output.

novemberborn added a commit to novemberborn/nyc that referenced this issue Feb 1, 2016
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 added a commit to novemberborn/nyc that referenced this issue Feb 1, 2016
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
Copy link
Contributor

#160 should resolve this.

novemberborn added a commit to novemberborn/nyc that referenced this issue Feb 3, 2016
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.
@bcoe bcoe closed this as completed in #160 Feb 4, 2016
@bcoe
Copy link
Member

bcoe commented Feb 4, 2016

@jamestalmage @sindresorhus give this a shot:

npm i nyc@next

If it does the trick I'll publish 5.6.0 to latest sometime tomorrow.

lloydcotten pushed a commit to lloydcotten/nyc that referenced this issue Feb 11, 2016
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.
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

No branches or pull requests

4 participants