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

Override Jest config by package.json

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/pgdejardin/master into master 8 years ago
  • Overview 1
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: pgdejardin

The developer can add a Jest config in package.json and override what it wants from the config file generated by react-script

I've made this to answer #1455 (closed) and #1830. I had to ignore *.stories.js from my coverage script and the coverage threshold and I didn't want to add them in the script himself but as Jest config.

This is a config that could be used :

"jest": {
    "collectCoverageFrom": [
      "src/**/*.{js,jsx}",
      "!src/**/*.test.{js,jsx}",
      "!src/**/*.stories.{js,jsx}",
      "!src/stories/**/*.{js,jsx}"
    ],
    "coverageThreshold": {
      "global": {
        "statements": 98,
        "branches": 91,
        "functions": 98,
        "lines": 98
      }
    }
  }

I hope it will help

Approval is optional

Closed by (Jul 25, 2025 4:49am UTC)

Merge details

  • The changes were not merged into master.

Activity


  • Administrator
    Administrator @root · 8 years ago
    Author Contributor

    Created by: pgdejardin

    In a second though, adding configuration in package.json isn't in the mind of the project.

    I close my PR.

Please register or sign in to reply
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
1
CLA Signed
1
CLA Signed
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
1
1 participant
Administrator
Reference: facebook/create-react-app!1941
Source branch: github/fork/pgdejardin/master

Menu

Explore Projects Groups Snippets