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

Override Jest config by package.json #1941

Closed
wants to merge 1 commit into from
Closed

Override Jest config by package.json #1941

wants to merge 1 commit into from

Conversation

pgdejardin
Copy link

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 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

@pgdejardin
Copy link
Author

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

I close my PR.

@pgdejardin pgdejardin closed this Apr 6, 2017
@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants