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

Code coverage is not instrumenting React components (React Native) #1542

Open
1 task
z7edge opened this issue Jan 2, 2024 · 0 comments
Open
1 task

Code coverage is not instrumenting React components (React Native) #1542

z7edge opened this issue Jan 2, 2024 · 0 comments

Comments

@z7edge
Copy link

z7edge commented Jan 2, 2024

I am using Detox with Cucumber for BDD test report. All test feature is working fine. Then I installed nyc plugin for generating detailed test coverage report but that is not instrumenting React components (such as App.js).
While using with jest it is working as expected but for some technical reasons we have to use it with Cucumber test.

Link to bug demonstration repository

Screenshot 2023-12-21 at 10 44 48 AM

Expected Behavior

Instrumentation of all the React components should happen.

Observed Behavior

All the React functional component code is going in Uncovered Line column of the coverage report.

Troubleshooting steps

  • still occurring when I put cache: false in my nyc config

Environment Information

# paste the output here

System:
    OS: macOS 14.1.1
    CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
    Memory: 27.83 MB / 16.00 GB
  Binaries:
    Node: 16.15.0 - /usr/local/bin/node
    Yarn: 1.22.18 - /usr/local/bin/yarn
    npm: 8.5.5 - /usr/local/bin/npm
  npmPackages:
    @babel/core: ^7.20.0 => 7.23.2 
    @babel/preset-env: ^7.20.0 => 7.23.2 
    @babel/register: ^7.22.15 => 7.22.15 
    @babel/runtime: ^7.20.0 => 7.23.2 
    @istanbuljs/nyc-config-babel: ^3.0.0 => 3.0.0 
    babel-jest: ^29.2.1 => 29.7.0 
    babel-plugin-istanbul: ^6.1.1 => 6.1.1 
    metro-react-native-babel-preset: 0.76.8 => 0.76.8 
    nyc: ^15.1.0 => 15.1.0 
    typescript: 4.8.4 => 4.8.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant