> For the complete documentation index, see [llms.txt](https://ploegert.gitbook.io/til/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ploegert.gitbook.io/til/programmy/react/create-react-app-has-a-default-test-setup-file.md).

# create-react-app Has A Default Test Setup File

In [*Configure Jest To Run A Test Setup File*](https://github.com/jbranchaud/til/blob/master/javascript/configure-jest-to-run-a-test-setup-file.md), I pointed to a way of configuring Jest in either the `package.json` or `jest.config.js` file with the `setupTestFrameworkScriptFile` value.

In a `create-react-app` project, this is not an option because `setupTestFrameworkScriptFile` is not one of the permitted config values for Jest.

There is a built-in value which happens to match what was recommended in the above post -- `<rootDir>src/setupTests.js`.

This means that there is no configuration required. Instead, just create a `setupTests.js` file in the `src` directory of your CRA project and add any framework setup you need there. That file is already configured to run when you invoke `yarn test`.

[source](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#initializing-test-environment)
