jest-preset-angular icon indicating copy to clipboard operation
jest-preset-angular copied to clipboard

[Bug]: Ignore coverage comments don't seem to work when a decorator is used

Open btvanhooser opened this issue 2 years ago • 2 comments

Version

12.2.2

Steps to reproduce

  1. Clone repo at: https://github.com/btvanhooser/angular-coverage-issue
  2. Start on the master branch and run npm install
  3. Run jest or npm run test
  4. Observe the missing coverage reported
  5. Switch to the feature/angular13 branch
  6. Run npm update
  7. Run jest or npm run test again
  8. Observe the full coverage

Expected behavior

Both branches should be reporting full coverage since the only missing coverage is the someFunction definition in app.component.ts and the class is supposed to be ignored due to the comment above it, as well as the clickResponse and someFunction definitions in listener.component.ts.

Actual behavior

The coverage is actually reported as missing, even though it is supposed to be ignored. The only successfully ignored coverage is in the listener.component.ts file on the someFunction method which is the only ignore comment that doesn't have a decorator near it.

Additional context

No response

Environment

Master branch:
System:
    OS: Windows 10 10.0.22000
    CPU: (16) ia32 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Binaries:
    Node: 16.13.1 - C:\Program Files (x86)\nodejs\node.EXE
    Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.3.2 - C:\Program Files (x86)\nodejs\npm.CMD
  npmPackages:
    jest: ^28.1.3 => 28.1.3

feature/angular13:
System:
    OS: Windows 10 10.0.22000
    CPU: (16) ia32 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Binaries:
    Node: 16.13.1 - C:\Program Files (x86)\nodejs\node.EXE
    Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.3.2 - C:\Program Files (x86)\nodejs\npm.CMD
  npmPackages:
    jest: ^27.5.1 => 27.5.1

btvanhooser avatar Sep 15 '22 23:09 btvanhooser

Anything on this?

btvanhooser avatar Oct 07 '22 04:10 btvanhooser

Checking in again?

btvanhooser avatar Oct 13 '22 18:10 btvanhooser

Hi, we are not responsible for code coverage. Code coverage is handled by istanbul itself based on transformed codes

ahnpnl avatar May 08 '24 09:05 ahnpnl