jest icon indicating copy to clipboard operation
jest copied to clipboard

[Bug]: Line under a decorator is not marked as covered in coverage report

Open srinesha opened this issue 1 year ago • 3 comments

Version

29.7.0

Steps to reproduce

  1. Create a decorator with JavaScript stage 3 decorator features. (No experimentalDecorators or emitDecoratorMetadata needed)
  2. Add a test to decorated function
  3. Run the test with coverage report

Expected behavior

Coverage report should cover 100% of the code in every category

Actual behavior

Coverage report leave the line below the decorator as uncovered line.

Additional context

Repo where you can recreate this issue: https://github.com/srinesha/decorator-coverage-issue

Steps:

  • yarn install to install dependencies
  • yarn test:coverage to run test and generate the coverage report

image image

Environment

System:
    OS: Linux 6.6 NixOS 24.05 (Uakari) 24.05 (Uakari)
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i7-1255U
  Binaries:
    Node: 22.4.1 - /etc/profiles/per-user/s1n7ax/bin/node
    Yarn: 1.22.22 - /etc/profiles/per-user/s1n7ax/bin/yarn
    npm: 10.8.1 - /etc/profiles/per-user/s1n7ax/bin/npm
    pnpm: 8.15.5 - /etc/profiles/per-user/s1n7ax/bin/pnpm

srinesha avatar Sep 05 '24 06:09 srinesha

It seems it's a issue from transpiled decorator code. The first decorator could never be covered.

image

After checking the transpiled code coverage, the first property indeed has not been covered. And there are 3 different processing for the properties: image

It is the same issue after changing the order. image

cenfun avatar Sep 16 '24 03:09 cenfun

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Oct 16 '24 04:10 github-actions[bot]

having the same issue

david2tm avatar Oct 17 '24 04:10 david2tm

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Nov 16 '24 06:11 github-actions[bot]

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

github-actions[bot] avatar Dec 16 '24 06:12 github-actions[bot]

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

github-actions[bot] avatar Dec 16 '24 06:12 github-actions[bot]

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

github-actions[bot] avatar Jan 16 '25 00:01 github-actions[bot]