You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ignore files/folders from code coverage report #3356
Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
N/A
The log given by the failure.
Normally this include a stack trace and some more information.
N/A
Mention any other details that might be useful.
Is there any way to exclude files/folders from test coverage (other than naming them .spec.ts)?
For example if I wanted to put some reusable bits of test code in src/app/common/testing/* I wouldn't want files included in this directory to be reported on.
Thanks!
Thanks! We'll be in touch soon.
Reacted by Nwel, Sascha Seewald, Wayne, Simon Basset, Nathraq, Juan J. Jimenez-Anca, Benjamin Charity and Kaloyan Kosev
Just wanted to make sure you all know that upgrading your project to karma-remap-istanbul:^0.3.0 will allow you to use their exclude property. marcules/karma-remap-istanbul#26
I just tried installing karma-remap-istanbul:^0.3.0 and karma-remap-istanbul:^0.4.0 with no luck at all.
Excluded path includiing '/data/' still in reports.
I confirm that both version where installed using npm install command, which indeed update the package config once successfully dependency installed, not the opposite.
I was able to exclude something once I understood and got a matching filter.
Not sure if it it was a question, but the problem is not the exclude or string implementation, the problem is the LCOV input data is not platform independent, which in my case using windows, it uses backslash as path separator in SF values.
After some research look like istanbul generate the LCOV file depending on the platform which add a platfom dependen matching which a worked around using a regexp accepting slash and backslash as separator.
Will need some time to fork istanbul repo and test it under windows locally.
Activity
dpmorrow commentedon Jan 25, 2017
Just wanted to make sure you all know that upgrading your project to karma-remap-istanbul:^0.3.0 will allow you to use their exclude property.
marcules/karma-remap-istanbul#26
Wolfium commentedon Jan 31, 2017
I just tried installing karma-remap-istanbul:^0.3.0 and karma-remap-istanbul:^0.4.0 with no luck at all.
Excluded path includiing '/data/' still in reports.
karma.conf.js:
remapIstanbulReporter: {
remapOptions: {
exclude: '/data/',
},
reports: {
html: 'coverage',
lcovonly: './coverage/coverage.lcov'
}
},
Versions:
angular-cli: 1.0.0-beta.24
Thanks in advance for any ideas or help?
dpmorrow commentedon Jan 31, 2017
@Nestor forgive me but I just want to be sure that you:
Not totally sure myself how the string implementation works but if everything else checks maybe switch to regex?
HTH
Wolfium commentedon Feb 1, 2017
Hi, @dpmorrow, answers follow:
After some research look like istanbul generate the LCOV file depending on the platform which add a platfom dependen matching which a worked around using a regexp accepting slash and backslash as separator.
Will need some time to fork istanbul repo and test it under windows locally.
delasteve commentedon Feb 23, 2017
When RC is released you will be able to configure the following section in the
.angular-cli.jsonfile:hansl commentedon Feb 23, 2017
Fixed in master by #4966
gregbown commentedon May 14, 2018
With the latest CLI 6+ add excluded files or paths to angular.json -> test -> options like so:
I should add, this addition was found by going through the schema
angular-automatic-lock-bot commentedon Sep 8, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.