docs: Document --testFailureExitCode
#10542
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Includes the
--testFailureExitCode
config parameter in the documentation. This parameter was added in the 21.0.0 release by #4067 but wasn't included in the release notes or added to the documentation.From a motivation perspective, at my company we're incorporating a variety of small
create-react-app
's into a much larger product that has a handrolled continuous integration system. It considers a non-zero exit code of a testing tool to be a build environment failure and will abort subsequent steps (it scoops up the test reports and process them to determine test failures). Given Jest's default behaviour of returning1
for both test failures and tool failures I was going to need to find a way to distinguish between a test and a tool failure. I tried searching for this exact configuration in the docs and generally on google and came up empty, and then randomly stumbled on this CLI/config parameter when playing with a custom test runner (the example logs the whole config object to the console).It'd be nice for this to be included in the official documentation so (a) others could benefit and (b) we had some confidence that it's not going to silently dissapear or become broken.
I've backdated it through the past versions as it was added before the oldest version of the documentation currently on the website.
Test plan
Ran up the website following contributor instructions (
yarn
,yarn start
in thewebsite
directory). Item appears in the TOC and renders correctly.