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] ES6 import and Flow pragma have issues with coverage #2339

Closed
migueloller opened this issue Dec 15, 2016 · 9 comments
Closed

[coverage] ES6 import and Flow pragma have issues with coverage #2339

migueloller opened this issue Dec 15, 2016 · 9 comments

Comments

@migueloller
Copy link

image

Using jest@18.0.0 with babel-jest@18.0.0.

Here is my .babelrc:

{
  "presets": [
    ["env", {
      "targets": {
        "node": 7.2
      },
      "whitelist": [
        "transform-class-properties",
        "transform-object-rest-spread",
        "transform-flow-strip-types"
      ]
    }]
  ]
}

Here is another screenshot but separating import and export into different lines:
image

Any ideas what might be going on?

@thymikee
Copy link
Collaborator

thymikee commented Dec 19, 2016

We use istanbul to generate the coverage, so maybe it's better to file an issue there?

@thymikee
Copy link
Collaborator

cc: @DmitriiAbramov

@aaronabramov
Copy link
Contributor

unfortunately we instrument already transpiled code, so there can be a lot of invisible things that mess up the coverage report like that.
i really hope this #2290 will solve this isuue

@migueloller
Copy link
Author

@DmitriiAbramov, would it help if I ran the tests on the transpiled code and posted a screenshot of that instead?

@aaronabramov
Copy link
Contributor

@migueloller i have an idea of what the resulting code looks like and there's nothing we can really do now.
good thing is that it usually only messes up the top of the file (imports) and they are not that important.
Does it provide a readable coverage report for the rest of the file for you?

@migueloller
Copy link
Author

migueloller commented Dec 19, 2016

@DmitriiAbramov,

I haven't had any other coverage issues with other files. 😄

The screenshot I posted is a single file, it's just exporting some utilities as named exports for easier access.

EDIT: For now I'm just ignoring that file specifically when generating coverage reports.

@aaronabramov
Copy link
Contributor

@migueloller let's wait for #2290 and see if it fixes it :)

@migueloller
Copy link
Author

@DmitriiAbramov, sounds good!

@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 14, 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

3 participants