Open jdelucaa opened 4 years ago
Same here. CRA shoudl really support reporter
.
Also when trying to use jest-junit
, the proposed workaround in #2474 does not work for me in watch mode.
When I try this:
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --coverage --watch --reporters=default --reporters=jest-junit",
"eject": "react-scripts eject"
},
in combination with
"jest": {
"coverageReporters": [
"json",
"lcov",
"text",
"clover",
"cobertura"
]
}
and run npm test
, all cover report files are generated EXCEPT the Junit one. What am i doing wrong?
Ah sorry. My bad. it was a problem with the jest-junit
settings. The workaround works now.
However, it would be way more convenienet if CRA supported reporters
and also coverage-directory
.
Is your proposal related to a problem?
CRA only supports overriding a few Jest options and
reporters
is not one of them. I know that I can add reporters via cli--reporters=my-reporter
, the problem is that I would like to pass in some options to that, but reporter options are not available via cli (https://jestjs.io/docs/en/next/cli#--reporters).I really don't want to eject my CRA setup, so i wish it was more flexible when it comes to Jest configurations.
Describe the solution you'd like
This is what I'd like to be able to do:
Describe alternatives you've considered
I could use something like craco, but it would be even nicer to have it (and other Jest configs) out of the box in CRA.
Additional context
https://github.com/facebook/create-react-app/issues/2474 https://github.com/facebook/create-react-app/issues/6224