Any kind soul could help me to "How to use the command-line coverage in my Vitest and Typescript project"???? It simply won't return me the coverage report.
It only return me how many tests have passed and the ones that failed.
I've install the "@vitest/-coverage-v8" and the command i'm running in the terminal is "npx vitest run --coverage".
The funny thing is that appears in my terminal this: "Coverage enabled with v8". But it runs one time and then stop.
What i'm missing???
First, make sure that @vitest/coverage-v8 is the same version as vitest. Then try setting tests.coverage.reportOnFailure to true if you're still not getting reports.
https://github.com/vitest-dev/vitest/issues/3259#issuecomment-1528875754 https://vitest.dev/config/#coverage-reportonfailure
It will only show the report, when all of your tests are passed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With