Closed Swatinem closed 9 years ago
I’m not sure if its just the babel source maps that are strange for import/export, or if they are really supposed to be treated as declarations rather than statements? If that’s the case then a re-export only file really has zero statements/functions/lines worth covering.
I’m wondering if we could just ignore things that have line: 0
in the report step. That way those things should not show up in reports at all.
I will try that tomorrow when I have some time :-)
I'm gonna go ahead and close this issue @Swatinem. We can add more specific issues as needed. Thanks for tackling this!
My PR #12 fixes the case that functions that were not part of the code we not correctly ignored and were thus reported as uncovered.
While that particular issue is fixed now, the problem still exists that istanbul reports functions (and statements / branches / lines) as found, even though they are not present in my source file at all.
For example the code from PR #12
export {foo, bar} from "foobar"
reportsAnd the one line that is reported is line 0, haha, so it means that it is not even highlighted in the html report. And for the statements, all 6 have
skip: true
set, but it shows only 2 ignored because those 2 are not covered (the return statements inside the ignored functions)