Ari Perkkiö

Results 391 comments of Ari Perkkiö

> Any update on this issue. Now I'm facing the same issue and can't see the right coverage No updates from Vitest side. It's still an upstream issue. We don't...

> It's funny that this is a critical issue but still not be fix by anyside for almost 1 year I would recommend to follow https://github.com/nuxt/test-utils/issues/891. There has been no...

The minimal reproduction seems to work properly with fix from - #8418 ```json "@vitest/coverage-v8": "https://pkg.pr.new/@vitest/coverage-v8@93cf5cc", "vitest": "https://pkg.pr.new/vitest@93cf5cc", ```

Could you set up a minimal setup that demonstrates the issue? And also write down what is the expected/better result that the setup should produce? I could then use that...

Thanks for the repro @gtbuchanan. In StackBlitz you can use `coverage.provider: 'istanbul'` to get coverage working. I think we can proceed with adding `project.root` filtering mentioned on https://github.com/vitest-dev/vitest/issues/6331#issuecomment-2287887422.

There's related PR open that likely fixes this: https://github.com/vitest-dev/vitest/pull/6329

What's this line? It's importing something that doesn't exist. Removing it makes the coverage work. https://github.com/stramel/vitest-v8-coverage-repro/blob/0dea8002ec3583e2f244c8d5d10c9896b4ad1bff/test/basic.test.js#L2

> Appears to be a regression of a previous bug: https://github.com/vitest-dev/vitest/issues/5639 I don't think this is regression. Has this ever worked? 1. Calling `import levels from "../src/basic";` ends up loading...

Also note that `@vitest/coverage-istanbul` might work out-of-the-box here. It does not include CommonJS files as it does the instrumentation using Vite plugins. V8 coverage includes all files that **Node executed**...

I think we could add a try-catch around here with warning logging when this kind of issues happen. It would then not fail whole report generation. https://github.com/vitest-dev/vitest/blob/5d542035acb198bb7f74055e8aff26abf28dc2fb/packages/coverage-v8/src/provider.ts#L546