-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Vitest Coverage v8 & Istanbul Providers Broken #27003
Comments
Looks like something is different in the inspector. On Deno I get these coverage lines: [
// ...
{
scriptId: '406',
url: '/Users/marvinh/dev/test/deno-vitest-cov2/src/foo.test.js',
functions: [ [Object], [Object], [Object] ]
},
{
scriptId: '408',
url: '/Users/marvinh/dev/test/deno-vitest-cov2/src/foo.ts',
functions: [ [Object], [Object], [Object], [Object] ]
}
] Whereas in Node I get this: [
// ...
{
scriptId: '265',
url: 'file:///Users/marvinh/dev/test/deno-vitest-cov2/src/foo.test.js',
functions: [ [Object], [Object], [Object] ]
},
{
scriptId: '267',
url: 'file:///Users/marvinh/dev/test/deno-vitest-cov2/src/foo.ts',
functions: [ [Object], [Object], [Object], [Object] ]
}
] This is problematic because session.post("Profiler.takePreciseCoverage", async (error, coverage) => {
//...
const result = coverage.result.filter(filterResult);
resolve({ result });
});
function filterResult(coverage) {
if (!coverage.url.startsWith("file://")) {
return false;
}
if (coverage.url.includes("/node_modules/")) {
return false;
}
return true;
} I wasn't able to isolate it further as just doing the inspector stuff leads to the correct script urls being printed. Not sure why they are stripped with Steps to reproduce
|
Blocked on denoland/deno#27003.
This comment has been minimized.
This comment has been minimized.
Blocked on denoland/deno#27003.
Blocked on denoland/deno#27003.
Blocked on denoland/deno#27003.
Relates to #23882.
Version: Deno 2.1.1
The v8 provider returns 0 for everything.



The istanbul provider is just wrong:
I think instanbul is mostly just mapping the line #s wrong, but it generally looks accurate-ish.
The text was updated successfully, but these errors were encountered: