Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #4645
Closed
Open
Issue created 7 years ago by Administrator@rootContributor
  • New related issue

  • Report abuse to administrator

  • New related issue

  • Report abuse to administrator

Missing code coverage data with CRA 2.0.0-next

Closed

Missing code coverage data with CRA 2.0.0-next

Created by: sbegaudeau

Is this a bug report?

Yes

Did you try recovering your dependencies?

Yes

Which terms did you search for in User Guide?

Yes

Environment

Environment:
  OS:  Windows 10
  Node:  10.4.1
  Yarn:  1.7.0
  npm:  6.1.0
  Watchman:  Not Found
  Xcode:  N/A
  Android Studio:  Not Found

Packages: (wanted => installed)
  react-scripts: ^2.0.0-next.3e165448 => 2.0.0-next.b2fd8db8

Steps to Reproduce

We have migrated to a monorepo using CRA next, everything works fine except that the code coverage of the test is only working for the main application project. It does not work anymore for the other project where our components are.

  1. Clone this commit from our project, install the dependencies with yarn install and run the test with coverage using yarn coverage. Everything works fine, the code coverage is working as seen in the Travis build.
  2. Now checkout this commit which configures everything for a monorepo architecture with two packages (app and core). Install everything and run the tests once again. As you could see it in the Travis build, the same tests are executed but the coverage report does not include anything anymore.

Expected Behavior

The code coverage report should include all the code covered by the executed tests.

Actual Behavior

Before

After

Reproducible Demo

Clone this commit.

  • yarn install
  • yarn coverage

The issue may be coming from the Jest config of CRA 2.0.0 next which seems to only look in the source folder here.

collectCoverageFrom: ['src/**/*.{js,jsx,mjs}']

  1. Oh no!

    You are trying to upload something other than an image. Please upload a .png, .jpg, .jpeg, .gif, .bmp, .tiff or .ico.

    Incoming!

    Drop your designs to start your upload.
Tasks
0

No tasks are currently assigned. Use tasks to break down this issue into smaller parts.

Linked items
0

Link issues together to show that they're related. Learn more.

Activity


  • Administrator
    Administrator @root · 7 years ago
    Author Contributor

    Created by: Timer

    Not sure if this is related, but you have the wrong version of the beta installed:

    Packages: (wanted => installed)
      react-scripts: ^2.0.0-next.3e165448 => 2.0.0-next.b2fd8db8

    Please remove the caret and re-install.

  • Administrator
    Administrator @root · 7 years ago
    Author Contributor

    Created by: sbegaudeau

    Thanks but we have tried by updating to the latest version of the beta and the issue remain.

    Environment:
      OS:  Windows 10
      Node:  10.4.1
      Yarn:  1.7.0
      npm:  6.1.0
      Watchman:  Not Found
      Xcode:  N/A
      Android Studio:  Not Found
    
    Packages: (wanted => installed)
      react-scripts: 2.0.0-next.3e165448 => 2.0.0-next.3e165448
  • Administrator
    Administrator @root · 7 years ago
    Author Contributor

    Created by: Timer

    /cc @bradfordlemley

  • Administrator
    Administrator @root · 7 years ago
    Author Contributor

    Created by: bradfordlemley

    Should be fixed by PR #4649.

  • Administrator
    Administrator @root · 6 years ago
    Author Contributor

    Created by: stale[bot]

    This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

  • Administrator
    Administrator @root · 6 years ago
    Author Contributor

    Created by: stale[bot]

    This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.

Please register or sign in to reply
0 Assignees
None
Assign to
Labels
2
issue: bug stale
2
issue: bug stale
    Assign labels
  • Manage project labels

Milestone
No milestone
None
Due date
None
None
None
Time tracking
No estimate or time spent
Confidentiality
Not confidential
Not confidential

You are going to turn on confidentiality. Only project members with at least the Reporter role, the author, and assignees can view or be notified about this issue.

Lock issue
Unlocked
1
1 participant
Administrator
Reference: facebook/create-react-app#4645

Menu

Explore Projects Groups Snippets