Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
srinesha opened this issue Sep 5, 2024 · 3 comments
Open

Comments

@srinesha
Copy link

srinesha commented Sep 5, 2024

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
@cenfun
Copy link

cenfun commented Sep 16, 2024

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

Copy link

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 github-actions bot added the Stale label Oct 16, 2024
@david2tm
Copy link

having the same issue

@github-actions github-actions bot removed the Stale label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants