analogjs / analog

The fullstack meta-framework for Angular. Powered by Vite and Nitro
https://analogjs.org
MIT License
2.5k stars 236 forks source link

Invalid coverage report #1212

Open kevinkasper opened 1 month ago

kevinkasper commented 1 month ago

Please provide the environment you discovered this bug in.

Clone minimal reproducible example:

https://github.com/kevinkasper/analogjs-vite-plugin-angular-coverage-mre

  1. yarn install
  2. yarn vitest --coverage --run

Which area/package is the issue in?

vite-plugin-angular

Description

If the minimal reproducible example is executed, a code coverage of 100% is displayed, although no test covers the code.

Many thanks in advance!

Please provide the exception or error you saw

❯ yarn vitest --coverage --run
yarn run v1.22.22
$ /Users/FooBar/analogjs-vite-plugin-angular-coverage-mre/node_modules/.bin/vitest --coverage --run

 RUN  v2.0.3 /Users/FooBar/analogjs-vite-plugin-angular-coverage-mre
      Coverage enabled with v8

 ✓ src/app/app.component.spec.ts (1)
   ✓ AppComponent (1)
     ✓ test

 Test Files  1 passed (1)
      Tests  1 passed (1)
   Start at  22:48:35
   Duration  793ms (transform 216ms, setup 161ms, collect 187ms, tests 34ms, environment 152ms, prepare 216ms)

 % Coverage report from v8
------------------|---------|----------|---------|---------|-------------------
File              | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
------------------|---------|----------|---------|---------|-------------------
All files         |     100 |      100 |     100 |     100 |                   
 app.component.ts |     100 |      100 |     100 |     100 |                   
------------------|---------|----------|---------|---------|-------------------
✨  Done in 2.42s.

Other information

No response

I would be willing to submit a PR to fix this issue

DerHerrGammler commented 1 month ago

Same issue not only with v8 coverage provider but as well with istanbul coverage provider.