-
-
Notifications
You must be signed in to change notification settings - Fork 361
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
unable to exclude node_modules #953
Comments
@ssube can you provide a simpler example? I've been trying with your repo for a few hours now and there are so many steps involved. I've got things to a point where |
@JaKXz sure, I can isolate something. I do have two repos using nyc and it looks like your PR is in isolex, the more complicated of the two. The branch of noicejs that I linked at the top (https://github.com/ssube/noicejs/tree/feature/coverage) should work with a Which part of the build broke? I can try to remove that entirely and maybe reduce it to just webpack. Without webpack involved, the coverage reports do appear to work, so I suspect the interaction between nyc and webpack or the TS loader. |
@ssube got it! ssube/noicejs#32 it's definitely not perfect though. Honestly I'm not sure what the source of the issue is... but, my guess is because of the webpack compilation into one big file that includes sourcemaps that point inside I think the same fix should work in isolex, I just can't confirm because I'm seeing test failures because I'm missing ISOLEX_ environment variables |
Your nyc-configuration change definitely fixes the report, with As you note, the main bundle and the 25-30MB sourcemap comes from webpack, which appears to still be causing the high memory usage. I have a few ideas on ways to preprocess the sourcemap before running nyc/istanbul at all, which might be able to help. Since my goal is to ignore coverage from node_modules entirely, removing them from the map shouldn't have many downsides. |
@ssube could you please test with #1010? We're supposed to re-filter the coverage data after using source-maps to remap, but unfortunately the current release does this re-filter before processing source-maps. You can install this test version with
Obviously do not merge that change to package.json into a mainline branch, once #1010 is merged the branch on my fork will be deleted. As for source-maps being huge this is likely due to your sourcemaps directly containing the |
|
Link to bug demonstration repository.
https://github.com/ssube/noicejs/tree/feature/coverage
Expected Behavior
Running
npm install && make
should report test coverage for code undersrc/
andtest/
, somewhere around the 80% mark (+/- recent changes).Observed Behavior
Tests runs with coverage, but the numbers are well off from where they should be:
This seems to be caused by

node_modules
appearing in the report:Configuring
package.json
to ignore**/node_modules/**
does not seem to help. The report appears to be the same with or without that config, as though it was being ignored. None of the options I'm passing should override that, as far as I can tell.On a second project with a larger set of dependencies, nyc cannot finish instrumenting
node_modules
without at least--max-old-space-size=8192
and even then, instrumenting some modules seems to break them.Forensic Information
Operating System:
Environment Information:
package versions
The text was updated successfully, but these errors were encountered: