Skip to content

Commit 5dc7c38

Browse files
committed
Add Test Files In create-react-app as a react til
1 parent fdc3550 commit 5dc7c38

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
1010
For a steady stream of TILs from a variety of rocketeers, checkout
1111
[til.hashrocket.com](https://til.hashrocket.com/).
1212

13-
_651 TILs and counting..._
13+
_652 TILs and counting..._
1414

1515
---
1616

@@ -461,6 +461,7 @@ _651 TILs and counting..._
461461
- [Quickly Search For A Component With React DevTools](react/quickly-search-for-a-component-with-react-devtools.md)
462462
- [Read Only Input Elements](react/read-only-input-elements.md)
463463
- [Rendering Multiple Nodes With Fragments](react/rendering-multiple-nodes-with-fragments.md)
464+
- [Test Files In create-react-app](react/test-files-in-create-react-app.md)
464465
- [Use A Ref To Autofocus An Input](react/use-a-ref-to-autofocus-an-input.md)
465466
- [Use withRouter To Pass Down React-Router History](react/use-withrouter-to-pass-down-react-router-history.md)
466467
- [Visually Select A React Element For Inspection](react/visually-select-a-react-element-for-inspection.md)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Test Files In create-react-app
2+
3+
Any `.js` files placed in the `__tests__` directory will be treated as tests
4+
by Jest when running `yarn test`. If you don't want to place all of your
5+
files in that directory and especially if you want to co-located your test
6+
files with the source files, you can name them with the `.test.js` or
7+
`.spec.js` suffixes.
8+
9+
Any files in your create-react-app project ending in these suffixes will be
10+
treated by Jest as test files and included in test runs.
11+
12+
There are [more
13+
details](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#running-tests)
14+
in the docs.

0 commit comments

Comments
 (0)