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]: Jest coverage is reporting a line as untested #13627

Closed
Shereef opened this issue Nov 18, 2022 · 9 comments
Closed

[Bug]: Jest coverage is reporting a line as untested #13627

Shereef opened this issue Nov 18, 2022 · 9 comments

Comments

@Shereef
Copy link

Shereef commented Nov 18, 2022

Version

28.1.3

Steps to reproduce

Steps:

  1. Clone https://github.com/Shereef/graphql-jest-coverage-attribute
  2. run npm run test:cov

Expected behavior

Should get 100% coverage

Actual behavior

It's reporting 85.71% because of an attribute @Query(() => String)

Additional context

If you look at this file and delete the attribute parameter to @Query() you will get 100% coverage but the project will not work.

import { Resolver, Query } from '@nestjs/graphql';

@Resolver()
export class AppResolver {
  @Query(() => String)
  getHello(): string {
    return 'Hello World!';
  }
}

Environment

System:
    OS: macOS 13.0.1
    CPU: (10) arm64 Apple M1 Pro
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    npm: 8.19.2 - ~/node_modules/.bin/npm
  npmPackages:
    jest: 28.1.3 => 28.1.3
@Shereef
Copy link
Author

Shereef commented Nov 18, 2022

I didn't know which package introduced this so I also filed this istanbuljs/istanbuljs#707

@davidediak
Copy link

davidediak commented Dec 15, 2022

Did you find a solution?

@Shereef
Copy link
Author

Shereef commented Dec 15, 2022

Did you find a solution?

No sir, just put /* istanbul ignore next */ before the arrow function

P.S. I hand typed this comment from my phone
Please spell check the code

@davidediak
Copy link

davidediak commented Dec 16, 2022

Hey, thanks for answering, but my issue was regarding an nx/Angular project, so a case different from yours.

I found the solution here

@github-actions
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 Jan 15, 2023
@Shereef
Copy link
Author

Shereef commented Jan 16, 2023

Any update on this ?

@github-actions github-actions bot removed the Stale label Jan 16, 2023
@github-actions
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 Feb 15, 2023
@github-actions
Copy link

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 github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 17, 2023
@github-actions
Copy link

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 github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants