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
Setting testing.collectCoverageFrom is not passed to Jest.
Expected behavior:
It should pass it through
Steps to reproduce:
Add collectCoverageFrom with a value (i.e. with a single file, or a set with negation) and set collectCoverage to true. The coverage generated will not match the expectation passed in.
It's also worth noting that collectCoverageFrom is potentially not the only option affected by this as anything set to undefined in the defaults will not be set (unless set in the subsequent block of if statements)
I'll raise a PR for this if I get a chance
Workaround
Assume that all files loaded by Jest will be covered and use coveragePathIgnorePatterns to negate anything you don't want.
If a file is not covered in your output, it means you have not loaded it in any of your tests.
Note: Puppeteer doesn't contribute to coverage so don't expect e2e tests to add to coverage 😉
The text was updated successfully, but these errors were encountered:
Stencil version:
I'm submitting a:
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/
Current behavior:
Setting
testing.collectCoverageFrom
is not passed to Jest.Expected behavior:
It should pass it through
Steps to reproduce:
Add
collectCoverageFrom
with a value (i.e. with a single file, or a set with negation) and setcollectCoverage
to true. The coverage generated will not match the expectation passed in.Related code:
https://github.com/ionic-team/stencil/blob/master/src/testing/jest/jest-config.ts#L39
https://github.com/ionic-team/stencil/blob/master/src/testing/jest/jest-config.ts#L45-L49
Other information:
https://github.com/ionic-team/stencil/blob/master/src/testing/jest/jest-config.ts#L39
There is no
default
defined for this option (see collectCoverageFrom docs and, beingundefined
means that it is not looped over in the function here:https://github.com/ionic-team/stencil/blob/master/src/testing/jest/jest-config.ts#L45-L49
It's also worth noting that
collectCoverageFrom
is potentially not the only option affected by this as anything set toundefined
in the defaults will not be set (unless set in the subsequent block ofif
statements)I'll raise a PR for this if I get a chance
Workaround
Assume that all files loaded by Jest will be covered and use
coveragePathIgnorePatterns
to negate anything you don't want.If a file is not covered in your output, it means you have not loaded it in any of your tests.
Note: Puppeteer doesn't contribute to coverage so don't expect
e2e
tests to add to coverage 😉The text was updated successfully, but these errors were encountered: