Closed cliren closed 8 years ago
Will check this later, thank you for your report!
This is a test done by unmodified istanbul , so the report will be transpiled code.
If you like to see untouched code in the report, you can try isparta.
I try to update the example here: https://github.com/zordius/react-jsx-coverage-example , the report showed original code but coverage 100%....strange. Then I found there are some issues in isparta now ( https://github.com/douglasduteil/isparta/issues/96 , https://github.com/douglasduteil/isparta/issues/99 https://github.com/douglasduteil/isparta/issues/108 ) .....So far I can not fix this and still need to wait for new isparta or istanbul.
Ya, I checked your example, its strange! I will wait for it and thanks for looking into this.
I was waiting for a fix from isparta, doesn't look like its out yet. Here is what I found latest:
Example coverage:
The culprit line in the below coverage report is the line: var _extends = Object.assign || function (target) { ...
https://github.com/cliren/react-jsx-coverage-example/blob/master/coverage/lcov-report/src/react-components/UserProfileLink.jsx.html
Its caused by the es6 spread operator
<a href={this.props.linkUrl} {...additionalProps}>{this.props.linkText}</a>
Any thoughts on how we can exclude this in istanbul report ?
Applying 'transform-runtime' helped with the ES6 spread operator. There are few other transpilations which have the same issue. I will check appropriate babel plugins and apply them. Closing this as know the root cause.
Firstly thanks for continuous support!
If you take a look at this example https://github.com/cliren/react-jsx-coverage-example and inspect coverage, for coverage/lcov-report/src/react-components/UserProfileLink.jsx.html, you will the see below lines. The actual code (lines, branches and statements) are 100% covered but looks like the tool is taking the transformed code into consideration and lowering the branch and statement coverage. Is there a way to ignore it and have the coverage reflect the actuals?