mirror of
https://github.com/jbranchaud/til
synced 2026-01-04 23:58:01 +00:00
Add Test Files In create-react-app as a react til
This commit is contained in:
14
react/test-files-in-create-react-app.md
Normal file
14
react/test-files-in-create-react-app.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# 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.
|
||||
Reference in New Issue
Block a user