-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
adding ability to change reported root dir file path #153
Comments
Could you provide some more information for this. Maybe an example of file structure, |
Thanks for the additional information. This feature request makes sense. I think I've run into that same exact problem myself couple of years ago with different test runner and reporter integration. Sonarqube can be tricky with relative paths. To solve this I'm thinking about adding a new configuration option that users could use to modify the In your case the configuration would look something like this: test: {
reporters: 'vitest-sonar-reporter',
sonarReporterOptions: {
onWriteFilePath(path: string) {
// path is "apps/ui/src/app/app.spec.tsx"
return `frontend/${path}`;
}
}
} |
hi @AriPerkkio in this case I could use import * as path from 'path';
...
test: {
reporters: 'vitest-sonar-reporter',
sonarReporterOptions: {
onWriteFilePath(reportPath: string) {
// path is "apps/ui/src/app/app.spec.tsx"
return path.relative("..", reportPath);
}
}
} |
Yes, exactly like that. I'll try to implement this in a week or so. |
Looks like support from Vitest's side is needed first: vitest-dev/vitest#5042. Currently custom |
This is now included in |
Thanks a lot! |
Could you please add ability to define root dir file path similar to
https://github.com/sh33dafi/jest-sonar#readme
it is important in monorepos where frontend is not in main folder but in subfolder and sonar is not able to process result file in such case due to invalid file path
The text was updated successfully, but these errors were encountered: