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

Invalid code coverage with react-native/jest/preprocessor.js #20404

Closed
3 tasks done
retyui opened this issue Jul 26, 2018 · 6 comments
Closed
3 tasks done

Invalid code coverage with react-native/jest/preprocessor.js #20404

retyui opened this issue Jul 26, 2018 · 6 comments
Labels
Platform: Linux Building on Linux. Resolution: Locked This issue was locked by the bot.

Comments

@retyui
Copy link
Contributor

retyui commented Jul 26, 2018

Environment

  React Native Environment Info:
    System:
      OS: Linux 4.15 Linux Mint 18.3 (Sylvia)
      CPU: x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
      Memory: 1.10 GB / 7.67 GB
      Shell: 2.7.1 - /usr/bin/fish
    Binaries:
      Node: 8.11.3 - /usr/bin/node
      Yarn: 1.7.0 - /usr/bin/yarn
      npm: 6.2.0 - /usr/bin/npm
    SDKs:
      Android SDK:
        Build Tools: 23.0.1, 26.0.3, 27.0.3, 28.0.1
        API Levels: 23, 25, 26, 28
    npmPackages:
      react: 16.4.1 => 16.4.1 
      react-native: ^0.56.0 => 0.56.0 
    npmGlobalPackages:
      react-native-cli: 2.0.1

Description

We use js Generators in own project, and when we run test jest --coverage we have a bad result because of the react-native/jest/preprocessor.js polyfilled function*(){} and create some helper function that affect to coverage result

Reproducible Demo

Info: https://gist.github.com/retyui/760ff91c0fab7310f8cea8c7e5c43978
Result:
image

@react-native-bot react-native-bot added the Platform: Linux Building on Linux. label Jul 26, 2018
@stale
Copy link

stale bot commented Oct 24, 2018

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added Stale There has been a lack of activity on this issue and it may be closed soon. and removed Stale There has been a lack of activity on this issue and it may be closed soon. labels Oct 24, 2018
@retyui retyui closed this as completed Nov 26, 2018
@Traviskn
Copy link

Traviskn commented Jan 4, 2019

@retyui Did you find a solution to this? I am also having issues with code coverage reports after upgrading to react-native 0.57

@retyui
Copy link
Contributor Author

retyui commented Jan 5, 2019

@Traviskn I didn't find a solution to this problem

@vidit-bhatia
Copy link

@retyui I think we must open this issue again. This does not make sense I see exact same thing and this does not mkae sense my team has a mandate for 80% code coverage per component and I do not think anyone can achieve it with this bug

@cpojer
Copy link
Contributor

cpojer commented May 9, 2019

I recognize this issue exists but it's unlikely anyone will spend time on fixing this. I'll close this issue but if you need this fixed I recommend investigating and sending a PR with a fix :)

@cpojer cpojer closed this as completed May 9, 2019
@alexcanessa
Copy link

I'm just using babel-jest as a transform, instead of using the preprocessor and it worked.
Not sure yet if it's going to have bad consequences 😂

@facebook facebook locked as resolved and limited conversation to collaborators May 9, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label May 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Linux Building on Linux. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

6 participants