1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 15:18:01 +00:00
Files
til/react/test-files-in-create-react-app.md
2018-03-29 17:06:17 -05:00

15 lines
637 B
Markdown

# Test Files In create-react-app
Any `.js` files placed in the `__tests__` directory will be treated as tests
by Jest when running `yarn test`. If you don't want to place all of your
files in that directory and especially if you want to co-located your test
files with the source files, you can name them with the `.test.js` or
`.spec.js` suffixes.
Any files in your create-react-app project ending in these suffixes will be
treated by Jest as test files and included in test runs.
There are [more
details](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#running-tests)
in the docs.