Ari Perkkiö

Results 391 comments of Ari Perkkiö

> I still find it a bit strange that adding the comment fixes the issue of the import. It may seem that it works, but it's still causing incorrect coverage...

There's proper fix for this in https://github.com/vitest-dev/vitest/pull/7417. There we'll be able to actually identify whether file was executed by `vite-node`.

> Html reporter is the custom reporter you are asking for. Vitest will check for html reporter in the configuration to include the reporter from the ui package: check coverage...

You can also create > a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using a GitHub repository and there have manually created `node_modules` which contains the package that demonstrates the issue. It doesn't have to...

I'm not sure if this should be part of the core. Or at least it should be marked as very-very experimental all the time. Comparing images is very hard. There...

Looks like `esbuild` doesn't respect comments inside `switch`: [https://esbuild.egoist.dev/#W1siaW5kZXgudH...](https://esbuild.egoist.dev/#W1siaW5kZXgudHMiLHsiY29udGVudCI6ImV4cG9ydCBlbnVtIE9wdGlvbnMge1xuICBGb28gPSAnZm9vJyxcbiAgQmFyID0gJ2JhcicsXG59XG5leHBvcnQgZnVuY3Rpb24gZXhhbXBsZShvcHRpb246IE9wdGlvbnMpIHtcbiAgc3dpdGNoIChvcHRpb24pIHtcbiAgICBjYXNlIE9wdGlvbnMuRm9vOiB7XG4gICAgICByZXR1cm4gJ0Zvb29vb28hJztcbiAgICB9XG4gICAgY2FzZSBPcHRpb25zLkJhcjoge1xuICAgICAgcmV0dXJuICdCYWFhYWFyISc7XG4gICAgfVxuICAgIC8qIFRoaXMgaXMgcmVtb3ZlZCAtLSBAcHJlc2VydmUgKi9cbiAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgbmV4dCAtLSBAcHJlc2VydmUgKi9cbiAgICBkZWZhdWx0OiB7XG4gICAgICAvKiBUaGlzIGlzIHByZXNlcnZlZCAtLSBAcHJlc2VydmUgKi9cbiAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0IC0tIEBwcmVzZXJ2ZSAqL1xuICAgICAgcmV0dXJuICdOb3QgYSBmb28sIG5vdCBhIGJhcic7XG4gICAgfVxuICB9XG59XG4ifV0sWyJlc2J1aWxkLmNvbmZpZy5qc29uIix7ImNvbnRlbnQiOiJ7XG4gIFwiZm9ybWF0XCI6IFwiY2pzXCIsXG4gIFwiY2RuVXJsXCI6IFwiaHR0cHM6Ly9jZG4uc2t5cGFjay5kZXZcIixcbiAgXCJsZWdhbENvbW1lbnRzXCI6IFwiaW5saW5lXCJcbn0ifV0sWyJzdW0udHMiLHsiY29udGVudCI6ImV4cG9ydCBjb25zdCBzdW0gPSAoYTogbnVtYmVyLCBiOiBudW1iZXIpID0+IGEgKyBiIn1dXQ==): ```js switch (option) { ... /* This is removed -- @preserve */ /* istanbul ignore next -- @preserve */ default: {...

We can leave this as open as it's now marked as `upstream` issue. It's good for others who run into same issue. And maybe in future once Vite moves from...

@hyrious sure it does support. Without source maps code coverage in Vitest would be useless as most users are using code transforms. `@vitest/coverage-v8` works just fine with the reproduction as...

This is fixed by https://github.com/evanw/esbuild/commit/f6e64811d1109cb34ad670297e650bd4075999a8. With latest Vitest: ![Image](https://github.com/user-attachments/assets/f19348fb-f1b6-4408-abf9-d234e5d818bc) @douglasjunior your case works too, you just need to use the `@preserve` keyword to prevent ESBuild from removing it. If you...

Current implementation: ```js import { expect, it, vi } from 'vitest' let coverageCounter = 0 const nestedHoist = (coverageCounter++, vi.hoisted(() => { return 'Nested hoist' })) it('nesting vi.hoisted doesnt cause...