-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
nyc trying to cover babel plugin even though it's excluded via config #581
Comments
This enables the tests to be run with Mocha in Node without having to bundle them with Webpack first. This is now consistent with the debug build which uses Webpack and noop-loader. The babelrc config for the `tests` env has been split in 2 to not generate coverage reports when watching the files but still ignore static assets. The Babel plugin includes an ignore pragma for Istanbul because of a bug causes it to not be excluded via nycrc. istanbuljs/nyc#581
@NiGhTTraX thanks for the great reproduction, and sorry for the slow reply have been trying to gradually catch up on old GitHub issues. I did a tiny bit of digging using your example repo, and the issue seems to be an interaction between the exclude rules and he If you feel like contributing to the project, this is probably a pretty straight forward fix; I think it will be in |
nyc has a bug where it walks all the files when `all: true`. istanbuljs/nyc#581
So I found the real problem: the plugin is instrumented by
So yeah, not really a nyc bug. Maybe #649 would work around the problem, but I'd like to have the code not emit coverage reports in case other tools will read it instead of nyc. A foolproof workaround is to put the plugin in a separate folder and add a |
In a project that uses
babel-istanbul
andbabel-register
AND a custom babel plugin, nyc instruments the custom plugin even though it's in a folder excluded from coverage via.nycrc:exclude
.Expected Behavior
100% coverage on src/foobar.js and nothing else because nyc is set to exclude the
tests/
folder which includes the babel-plugin defined in .babelrc.Observed Behavior
Bonus Points! Code (or Repository) that Reproduces Issue
https://github.com/NiGhTTraX/nyc-exclude-bug
Forensic Information
Operating System: Ubuntu 16.04
Environment Information:
Node: v6.9.5
npm: 3.10.10
The text was updated successfully, but these errors were encountered: