-
Notifications
You must be signed in to change notification settings - Fork 91
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
Add --projectRoot option #415
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be passed to test-exclude
as cwd
as well?
Lines 39 to 45 in 7f1069d
this.exclude = new Exclude({ | |
exclude: exclude, | |
include: include, | |
extension: extension, | |
relativePath: !allowExternal, | |
excludeNodeModules: excludeNodeModules | |
}) |
I do not think so. This option affects only the paths in the lcov file. |
.options('project-root', { | ||
default: undefined, | ||
type: 'string', | ||
describe: 'specifies which points point to the root of the mono repository' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this option overlaps with the undocumented resolve
option. Have you tried using it as the projectRoot
in istanbul-reporter options?
projectRoot: this.resolve || process.cwd(),
With the current changes it feels like you'd need to keep projectRoot
and resolve
in sync manually.
Lines 136 to 139 in 7f1069d
.option('resolve', { | |
default: '', | |
describe: 'resolve paths to alternate base directory' | |
}) |
Line 97 in 7f1069d
const path = resolve(this.resolve, v8ScriptCov.url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I don't understand why the 'resolve' option is needed. Whatever I specify there, it does not affect the final files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried using this, but it didn't help me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
projectRoot only affects paths in lcov files. We are currently using a fork in a working project and it works fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some testing with the this.resolve
option now, and it indeed seems to have no effect at all. The v8ScriptCov.url
paths are absolute, not relative. No idea what that API is supposed to do.
I still think this same option should be used in
This feature is also something that is needed in |
Hello @rasimx could you provide a description in your PR of the problem you're trying to solve? I believe the |
@@ -74,7 +76,8 @@ class Report { | |||
reports.create(_reporter, { | |||
skipEmpty: false, | |||
skipFull: this.skipFull, | |||
maxCols: process.stdout.columns || 100 | |||
maxCols: process.stdout.columns || 100, | |||
projectRoot: this.projectRoot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer that we expose this reporterOptions configuration so that it can be configured in package configuration, or with @rasimx closing this for now, since I did't hear back from you with my last update. But, I'd be happy to land this work in the future if you're willing to update based on this suggestion. |
Checklist
npm test
, tests passingnpm run test:snap
(to update the snapshot)