-
Notifications
You must be signed in to change notification settings - Fork 2
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
Complete sourcepath in the SF line of lcov.info is missing #1
Comments
It is a common issue, We can resolve full path of the file with option const path = require("path")
// MCR coverage options
{
sourcePath: (filePath, info)=> {
if (!filePath.includes('/') && info.distFile) {
return `${path.dirname(info.distFile)}/${filePath}`;
}
return filePath;
}
} See |
Jeah, that looks better now. However I now have |
Try following const path = require("path")
// MCR coverage options
{
sourcePath: (filePath, info)=> {
const str = 'localhost-3200';
if (filePath.startsWith(str)) {
return filePath.slice(str.length);
}
if (!filePath.includes('/') && info.distFile) {
return `${path.dirname(info.distFile)}/${filePath}`;
}
return filePath;
}
} |
Unfortunately that results in |
That's weird. But I can't help you unless you provide the reproduction steps |
Here's the repro-case. Thanks for your help, really appreciate it. |
It seems that we need to remove // previous
// const str = "localhost-3200";
// please change to
const str = "localhost-3200/"; TN:
SF:src\App.vue
FN:1,(anonymous_0) |
That did the trick. Thanks! |
I followed the instructions and got coverage working as described. I noticed however, that the lcov.info is missing the full sourcepath of the specifiv files. It only lists the file name.
We get the following
SF:App.vue
instead ofSF:src/App.vue
, for example. The ladder is generated from vitest/unit-tests.Is there any configuration setting I can use here? It seems, that the information is somehow "there", since the generated html-report lists something like "http://localhost-3200/src/App.vue: App.vue".
The text was updated successfully, but these errors were encountered: