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

added check for ignoreSourceMap option #64

Closed
wants to merge 1 commit into from
Closed

added check for ignoreSourceMap option #64

wants to merge 1 commit into from

Conversation

tprince232
Copy link

Hi Matt. I am using the Karma Istanbul Reporter for an Angular 6 project with multiple custom projects/libraries. The projects import modules from each other, which come from the dist folder of the library. When run on a given project, the reporter would give the stats on the files in the dist folders of the libraries that are dependencies of the project being tested. The reporter was using the source-maps in these libraries to try to break down the tests to their sources, but it was generating paths that included "ng:", which resulted in an error on my Windows machine, since "ng:" is an invalid directory name. I do not really care about these source mappings for my purposes, and because it was causing this error, I created an option to ignore the source mappings.

I know the code I am submitting for this review may need further work, etc., but I figured this was the best way of reaching you with this feature request. Let me know what you think / next steps, or if there was some other way to do what I wanted.

I am attaching an image of one of my index files for one of the projects. See how when the reporter would attempt to write an index.html file for the first folder listed, the "ng:" in the path would cause the reporter to fail.

part of coverage result

@codecov-io
Copy link

codecov-io commented Feb 27, 2019

Codecov Report

Merging #64 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #64      +/-   ##
==========================================
+ Coverage    97.7%   97.74%   +0.03%     
==========================================
  Files           2        2              
  Lines         131      133       +2     
==========================================
+ Hits          128      130       +2     
  Misses          3        3
Impacted Files Coverage Δ
src/reporter.js 97.82% <100%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ce38d2d...1618f20. Read the comment docs.

@mattlewis92
Copy link
Owner

Hey thanks for this! I think you can get the behaviour you desire by excluding the dist files from the coverage report. So if you add "codeCoverageExclude": ["dist/**/*"] to your angular.json it should remove those files from the coverage report. Let me know if that works for you 😄

@tprince232
Copy link
Author

Hi Matt, adding "codeCoverageExclude": ["dist/**/*"] to my angular.json worked! I tried excluding the dist folders in a dozen different ways, but I had been focusing more on the Karma configuration files than the angular.json file. Thank you for getting back to me.

@tprince232 tprince232 closed this Mar 12, 2019
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

Successfully merging this pull request may close these issues.

3 participants