Skip to content

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.

2 participants