-
-
Notifications
You must be signed in to change notification settings - Fork 360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can no longer get NYC to use absolute paths in lcov.info #1277
Comments
nyc is complex with many options, my preference is to avoid unnecessary options as every option increases the learning curve. That is why I requested the removal of CC @bcoe |
@coreyfarrell – thanks for your feedback! Speaking of global options, is there a way to pass in options to a particular reporter that is exposed somewhere – e.g. the Short of that I would also be fine with a separate |
I ended up publishing my own plugin: It's not the most beautiful code I've ever written but it gets the job done. |
Is there still no solution besides @solymosi's custom plugin? I'm running coverage in a monorepo, and I need to upload the reports to Coveralls. But because the reports use paths relative to each package, Coveralls cannot parse them. If they had been absolute, the upload would have worked. |
A comment from istanbuljs/istanbuljs#529 helped me to resolve the issue. I just added this line to the jest config of packages in my monorepo: coverageReporters: [['lcov', { projectRoot: '../..' }]], |
@PaulRBerg did you ever find a solution? We have the same issue where we have several separate reports, with the paths to the files being relative to each monorepo workspace, so when we try to merge them, we end up with 3 entries for the same file, all with different paths. |
@RobbieTheWagner I can't remember unfortunately. |
File paths in
lcov.info
used to be absolute before 15.0.0. This has changed in the following PRs:It looks like these PRs do such a good job of "adding support for relative path option" that they remove the possibility to use absolute paths altogether, since
this.cwd
is now always set as theprojectRoot
for thelcovonly
module, which usespath.relative
without the option to turn this feature off.Is there some way to continue using absolute paths in
lcov.info
?If this would need changes in the code, I'm happy to prepare a PR.
The text was updated successfully, but these errors were encountered: