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

Exclude option ignored unless in nyc stanza of package.json #62

Closed
wKovacs64 opened this issue Oct 7, 2016 · 9 comments
Closed

Exclude option ignored unless in nyc stanza of package.json #62

wKovacs64 opened this issue Oct 7, 2016 · 9 comments

Comments

@wKovacs64
Copy link

wKovacs64 commented Oct 7, 2016

When using babel-plugin-istanbul, it appears if the nyc configuration object is included in the nyc stanza of package.json, everything is fine. But when attempting to use the same options in .nycrc or via the command-line, they are ignored (exclude, in particular).

Repro examples: https://github.com/wKovacs64/nyc-exclude-test (deleted)

Side note: in my real projects where I first ran into this, I require babel-register with mocha as opposed to nyc. The nyc documentation does it in the nyc configuration, so that's what I used in my reproduction cases, but it doesn't appear to make a difference.

@tteltrab
Copy link

tteltrab commented Jan 3, 2017

I just recreated this as well. The exclude option in a .nycrc file when using this package is ignored, but the files are ignored when the nyc configuration is in the package.json.

@bcoe
Copy link
Member

bcoe commented Jan 3, 2017

@tteltrab @wKovacs64 I believe there's another issue open on nyc related to this; will dig soon, any help appreciated.

@321ckatz123
Copy link

@bcoe the issue is here: istanbuljs/nyc#419.

NiGhTTraX added a commit to NiGhTTraX/react-test-buffet that referenced this issue Jan 30, 2017
Using nyc to instrument the files lead to false negatives, not to mention
incorrect call count for lines in the HTML report. Switched to
babel-plugin-istanbul.

Had to move the `excluded` stanza from `.nycrc` to `.babelrc` because of
istanbuljs/babel-plugin-istanbul#62
@bcoe
Copy link
Member

bcoe commented Feb 7, 2017

@321ckatz123 @wKovacs64 I believe we've landed a patch for this, could you give the following a try:

npm cache clear; npm i babel-plugin-istanbul@next

Thanks to @alpersogukpinar for identifying the underlying problem.

@wKovacs64
Copy link
Author

@bcoe babel-plugin-istanbul@next (4.0.0) is working as expected, my exclusion tests pass for command-line, .nycrc, and package.json. Thanks to all involved!

@321ckatz123
Copy link

@bcoe me as well. When can we get this pushed to npm?

@bcoe
Copy link
Member

bcoe commented Feb 8, 2017

@321ckatz123 the module is up, just not on latest yet; try this:

npm cache clear; npm i babel-plugin-istanbul@next.

@321ckatz123
Copy link

@bcoe, I understand how to get it now. I was more asking when is the next release (which I assume includes this) is going to get pushed?

@bcoe
Copy link
Member

bcoe commented Feb 9, 2017

@wKovacs64 @321ckatz123 this is published to latest now 👍

@bcoe bcoe closed this as completed Feb 9, 2017
randytsmith pushed a commit to randytsmith/javascript_testing that referenced this issue Apr 1, 2018
Using nyc to instrument the files lead to false negatives, not to mention
incorrect call count for lines in the HTML report. Switched to
babel-plugin-istanbul.

Had to move the `excluded` stanza from `.nycrc` to `.babelrc` because of
istanbuljs/babel-plugin-istanbul#62
dezine2dev added a commit to dezine2dev/Javascript-testing that referenced this issue Jul 4, 2018
Using nyc to instrument the files lead to false negatives, not to mention
incorrect call count for lines in the HTML report. Switched to
babel-plugin-istanbul.

Had to move the `excluded` stanza from `.nycrc` to `.babelrc` because of
istanbuljs/babel-plugin-istanbul#62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants