Skip to content
GitLab
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 Jun 19, 2018 by Administrator@rootContributor

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}']

Assignee
Assign to
Time tracking