code-coverage icon indicating copy to clipboard operation
code-coverage copied to clipboard

Seems "exclude" is ONLY respected by NYC report generation if excludeAfterRemap: true

Open bahmutov opened this issue 5 years ago • 2 comments

We want to respect "exclude" at all times, I think

bahmutov avatar Apr 30 '20 13:04 bahmutov

Yea I'm currently pulling my hair out trying to exclude node_modules from the report generation and I'm almost certain cypress is the problem.

https://stackoverflow.com/questions/61667843/how-do-i-exclude-node-modules-from-my-code-coverage

I've just confirmed adding excludeAfterRemap excludes the correct files but also breaks test coverage entirely.

wafer-bw avatar May 07 '20 23:05 wafer-bw

I also have an issue that excludeAfterRemap: true causes some files to be excluded, but more than I specified are excluded, and oddly, it seems the exclusions only occur if I have codeCoverage.exclude set (and not package.json's nyc.exclude).

Also if I remove excludeAfterRemap: true, then all the files show up without designated exclusions (whether specified in package.json or cypress.config.json). nyc report in this state likewise does not show the excluded files, but the lcov-report does show them when excludeAfterRemap: true is removed.

brettz9 avatar Nov 30 '22 19:11 brettz9