jest-preset-angular
jest-preset-angular copied to clipboard
[Bug]: Ignore coverage comments don't seem to work when a decorator is used
Version
12.2.2
Steps to reproduce
- Clone repo at: https://github.com/btvanhooser/angular-coverage-issue
- Start on the master branch and run
npm install
- Run
jest
ornpm run test
- Observe the missing coverage reported
- Switch to the
feature/angular13
branch - Run
npm update
- Run
jest
ornpm run test
again - 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
Anything on this?
Checking in again?
Hi, we are not responsible for code coverage. Code coverage is handled by istanbul itself based on transformed codes