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
  • Merge requests
  • !961

Add collectCoverageFrom option to collect coverage on files without any tests

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/macktrix/master into master Oct 25, 2016
  • Overview 4
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: macktrix

Adding collectCoverageFrom option to the config to cover files that have no tests. This is set to look for any file under the src/ directory.

Below is the coverage report prior to the change: screen shot 2016-10-25 at 15 46 11

And here is the coverage after the change with the same tests: screen shot 2016-10-25 at 15 46 42

It's worth noting this can currently be achieved by passing the arguments through npm test -- --coverage --collectCoverageFrom='src/**/*.{js,jsx}'. This change would make this the default behaviour. If a different path is required then passing it as an argument overrides the default.

For example if I only cared about the actions folder I could run: npm test -- --coverage --collectCoverageFrom='src/actions/*.{js,jsx}' screen shot 2016-10-25 at 16 11 13

A similar PR was already submitted #905 but the author hasn't responded in a while. This is also without the ignore path as I feel its unnecessary.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/macktrix/master