-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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 configuring reporters for Jest #2474
Comments
You should be able to pass it as a command line option. Since it doesn't seem to make sense for non-CI runs, you might as well do it like this: "test": "react-scripts test",
"test:ci": "react-scripts test --testResultsProcessor ./node_modules/jest-junit", and then set your CI server to run Hope this helps! |
After little bit experimentation, the correct command seems to be this. No need for
|
Thanks. I edited my comment. |
This seems to work, only if I put the absolute path for the
Now it works :-) (I tried this with react-scripts 0.9.5 with nodejs 6.11.2) |
I'm trying to use the CLI option from Are there any other ways that we can make the reporter works without ejecting CRA? |
@konekoya |
Wow! Thank you @jamime, you just made my day! |
Good one @jamime. Do we think this should be included in the documentation? |
@gaearon could |
@quantuminformation I feel your pain, that's why I made all Jest options configurable when you use craco to customize your CRA installation without ejecting. An overview of the configuration is available here. Sample craco.config.js file: module.exports = {
jest: {
configure: {
reporters: ["<rootDir>/my-custom-reporter.js"]
}
}
}; |
I've unlocked this as per #6224. |
If there are some proposals for how we could deal with this, I think it's worth reopening this issue - as the workaround no longer works (from what I read above). |
Would it be possible to add functionality to configure custom reporters for Jest, without doing an eject?
This kind of functionality is already implemented for coverage tools #1785
My use case: I am running builds in Jenkins, and I would like to create JUnit XML formatted test reports so that the test results are nicely integrated with Jenkins UI.
I tried using this: https://www.npmjs.com/package/jest-junit and configured
package.json
like thisThe end result is this:
There is another reporter package that is seems to do similar thing: https://github.com/michaelleeallen/jest-junit-reporter
The text was updated successfully, but these errors were encountered: