mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 23:28:02 +00:00
Add Test Files In create-react-app as a react til
This commit is contained in:
@@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
|
|||||||
For a steady stream of TILs from a variety of rocketeers, checkout
|
For a steady stream of TILs from a variety of rocketeers, checkout
|
||||||
[til.hashrocket.com](https://til.hashrocket.com/).
|
[til.hashrocket.com](https://til.hashrocket.com/).
|
||||||
|
|
||||||
_651 TILs and counting..._
|
_652 TILs and counting..._
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -461,6 +461,7 @@ _651 TILs and counting..._
|
|||||||
- [Quickly Search For A Component With React DevTools](react/quickly-search-for-a-component-with-react-devtools.md)
|
- [Quickly Search For A Component With React DevTools](react/quickly-search-for-a-component-with-react-devtools.md)
|
||||||
- [Read Only Input Elements](react/read-only-input-elements.md)
|
- [Read Only Input Elements](react/read-only-input-elements.md)
|
||||||
- [Rendering Multiple Nodes With Fragments](react/rendering-multiple-nodes-with-fragments.md)
|
- [Rendering Multiple Nodes With Fragments](react/rendering-multiple-nodes-with-fragments.md)
|
||||||
|
- [Test Files In create-react-app](react/test-files-in-create-react-app.md)
|
||||||
- [Use A Ref To Autofocus An Input](react/use-a-ref-to-autofocus-an-input.md)
|
- [Use A Ref To Autofocus An Input](react/use-a-ref-to-autofocus-an-input.md)
|
||||||
- [Use withRouter To Pass Down React-Router History](react/use-withrouter-to-pass-down-react-router-history.md)
|
- [Use withRouter To Pass Down React-Router History](react/use-withrouter-to-pass-down-react-router-history.md)
|
||||||
- [Visually Select A React Element For Inspection](react/visually-select-a-react-element-for-inspection.md)
|
- [Visually Select A React Element For Inspection](react/visually-select-a-react-element-for-inspection.md)
|
||||||
|
|||||||
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