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

allow setting of coverage reporters (or other jest config options) #1785

Closed
onelson opened this issue Mar 9, 2017 · 3 comments
Closed

allow setting of coverage reporters (or other jest config options) #1785

onelson opened this issue Mar 9, 2017 · 3 comments

Comments

@onelson
Copy link

onelson commented Mar 9, 2017

Normally, when using jest for testing in CI, we configure cobertura (so it can be parsed/visualized).
Usually we do this in our package.json

{
...
  "jest": {
    "coverageReporters": [
      "text",
      "cobertura"
    ]
  }
...
}

but this seems to be ignored when working with RCA.

I looked at perhaps using using react-scripts test -- --coverage --config ... to specify a config file for jest, but this yields a weird error:

> react-scripts test --env=jsdom --coverage --config=./jest/ci-conf.json

Error: Unknown config option "0" with value "./jest/ci-conf.json". This is either a typing error or a user mistake and fixing it will remove this message.

Specifying a config for jest is the worst case scenario, however, since it would require knowledge of what RCA normally provides. It would be much nicer to be able to override this in package.json

@ejfrancis
Copy link

ejfrancis commented Mar 31, 2017

+1 , I need cobertura but don't want to eject from CRA

danjamin added a commit to danjamin/create-react-app that referenced this issue Apr 25, 2017
- works when NOT ejected by merging default and app Jest options
- eject simply combines app and default into a single package.json jest field
@gaearon gaearon added this to the 0.10.0 milestone May 16, 2017
@gaearon
Copy link
Contributor

gaearon commented May 16, 2017

Fixed by #1830.

@gaearon gaearon closed this as completed May 16, 2017
@gaearon
Copy link
Contributor

gaearon commented May 16, 2017

Please help beta test the new version that includes this change!
#2172

@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 a pull request may close this issue.

3 participants