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

Coverage downgraded 24.49% after switching from Jest ^18.1.0 to ^19.0.2 #3260

Closed
lucasbento opened this issue Apr 5, 2017 · 5 comments
Closed

Comments

@lucasbento
Copy link

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Jest ^18.1.0 was reporting a coverage of 83.1% on Jest ^19.0.2 it reports only 58.6%, -24.49% of coverage between the versions, the report looks pretty much the same (see the images below).

If the current behavior is a bug, please provide the steps to reproduce and either a repl.it demo through https://repl.it/languages/jest or a minimal repository on GitHub that we can yarn install and yarn test.

To test on version 18.1.0:

  1. Clone master of https://github.com/lucasbento/create-graphql;
  2. yarn install && npm run bootstrap && npm test;
  3. open ./packages/coverage/index.html.

To test on version 19.0.2 (aerogear/create-graphql#82):

  1. Clone feature/upgradeAll of https://github.com/lucasbento/create-graphql;
  2. yarn install && npm run bootstrap && npm test;
  3. open ./packages/coverage/index.html.

What is the expected behavior?
The coverage should stay the same between versions.

Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.

npm: 3.10.10
yarn: 0.19.1
node: v6.9.5
OS: Mac OS X El Capitan 10.11.5 Also happening on CI (aerogear/create-graphql#83)

{
  "testEnvironment": "node",
  "testPathIgnorePatterns": [
    "/coverage/",
    "/dist/",
    "/generators/",
    "/node_modules/"
  ],
  "moduleDirectories": [
    "src",
    "node_modules"
  ],
  "coveragePathIgnorePatterns": [
    "/__tests__/",
    "/coverage/",
    "/dist/",
    "/generators/",
    "/node_modules/"
  ],
  "coverageDirectory": "./coverage/",
  "coverageReporters": [
    "lcov",
    "html"
  ],
  "collectCoverage": true,
  "collectCoverageFrom": [
    "**/**/*.js"
  ],
  "testPathDirs": [
    "generator/src",
    "create-graphql/src"
  ],
  "rootDir": "./packages/",
  "verbose": true
}

Version ^18.1.0

image

Version ^19.0.2

image

@aaronabramov
Copy link
Contributor

this is likely related to some other packages that were updated (istanbul, babel)

if you look at the detailed coverage
screen shot 2017-04-05 at 11 18 22 am
the newer version does a better job instrumenting the file and taking into account additional lines (the red highlight is messed up because of all the babel transformation. we can't really do much about it yet 😞)

@lucasbento
Copy link
Author

@DmitriiAbramov: thanks for answering back.

What can I do about it at the moment? Should this be considered a bug on Jest since it uses those packages? Should I open an issue somewhere else?

Thank you!

@aaronabramov
Copy link
Contributor

@lucasbento i'd say it looks more like the issue was fixed, and now you get a more accurate coverage report :)
If you have a threshold on your CI it probably makes sense to lower it (if it's failing right now)

@lucasbento
Copy link
Author

@DmitriiAbramov: alright, gonna close this issue and merge the PR.

Thank you again!

@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 May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants