Skip to content

Commit f3736e3

Browse files
committed
[elson] add docs to import jest-dom on before cra-3.3.0
1 parent 1e41cda commit f3736e3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/frontend-web-development/react-testing-library.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@
3636
As of create-react-app 3.3.0 (2019-12-04), you do not have to do the following steps. `create-react-app` installs the required package for you.
3737

3838
```sh
39-
npm install --save @testing-library/react @testing-library/jest-dom
39+
npm install --save-dev @testing-library/react @testing-library/jest-dom
40+
```
41+
42+
Import `jest-dom` at the beginning for test file
43+
44+
```
45+
import '@testing-library/jest-dom/extend-expect';
4046
```
4147

4248
## Running test

0 commit comments

Comments
 (0)