Is it possible to get jest junit report generated without ejecting? #207
Description
Is this a bug report?
No, a question, and a possible feature request.
I need to generate junit xml files from the jest test results to feed them to Jenkins.
There seems to be at least two solutions for that: jest-junit (https://www.npmjs.com/package/jest-junit) and jest-junit-reporter (https://www.npmjs.com/package/jest-junit-reporter). jest-junit seems to be more configurable, but I did not try them yet. I am not sure, probably the reports could be also be generated somehow via jasmine (I don't know jest, but somewhere I read that jasmine is jest's default framework, or sg like that?).
jest-junit and jest-junit-reporter seems to require setting the jest option "testResultsProcessor", however it is not possible with react-scripts-ts (affected version is 2.8.0, currently the latest).
I know this limitation comes from create-react-app, but could probably no problem if it is implemented in react-scripts-ts first.
After trying to install a reporter (by setting testResultsProcessor in package.json's "jest" section, I get):
• collectCoverageFrom
• coverageReporters
• coverageThreshold
• snapshotSerializers.
These options in your package.json Jest configuration are not currently supported by Create React App:
• testResultsProcessor
If you wish to override other Jest options, you need to eject from the default setup. You can do so by running npm run eject but remember that this is a one-way operation. You may also file an issue with Create React App to discuss supporting more options out of the box.
So currently my best bet seems to be ejecting, and maybe revert that once this is solved.
Should I also create such a ticket on the create-react-app project (in fact, I don't use and know that)?
On their npm page https://www.npmjs.com/package/@ontruck/react-scripts jest-junit is somehow already there as a dependency, but I did not investigated that.