Skip to content

Commit 567f36c

Browse files
balazsorban44iansu
authored andcommitted
Update testing-library package names in README (#7340)
1 parent 404af90 commit 567f36c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docusaurus/docs/running-tests.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -173,18 +173,18 @@ import 'jest-enzyme';
173173

174174
### Option 2: React Testing Library
175175

176-
As an alternative or companion to `enzyme`, you may consider using `react-testing-library`. [`react-testing-library`](https://github.com/kentcdodds/react-testing-library) is a library for testing React components in a way that resembles the way the components are used by end users. It is well suited for unit, integration, and end-to-end testing of React components and applications. It works more directly with DOM nodes, and therefore it's recommended to use with [`jest-dom`](https://github.com/gnapse/jest-dom) for improved assertions.
176+
As an alternative or companion to `enzyme`, you may consider using `react-testing-library`. [`react-testing-library`](https://github.com/testing-library/react-testing-library) is a library for testing React components in a way that resembles the way the components are used by end users. It is well suited for unit, integration, and end-to-end testing of React components and applications. It works more directly with DOM nodes, and therefore it's recommended to use with [`jest-dom`](https://github.com/testing-library/jest-dom) for improved assertions.
177177

178178
To install `react-testing-library` and `jest-dom`, you can run:
179179

180180
```sh
181-
npm install --save @testing-library/react jest-dom
181+
npm install --save @testing-library/react @testing-library/jest-dom
182182
```
183183

184184
Alternatively you may use `yarn`:
185185

186186
```sh
187-
yarn add @testing-library/react jest-dom
187+
yarn add @testing-library/react @testing-library/jest-dom
188188
```
189189

190190
Similar to `enzyme` you can create a `src/setupTests.js` file to avoid boilerplate in your test files:
@@ -194,7 +194,7 @@ Similar to `enzyme` you can create a `src/setupTests.js` file to avoid boilerpla
194194
// this will ensure they're removed after each test.
195195
import '@testing-library/react/cleanup-after-each';
196196
// this adds jest-dom's custom assertions
197-
import 'jest-dom/extend-expect';
197+
import '@testing-library/jest-dom/extend-expect';
198198
```
199199

200200
Here's an example of using `react-testing-library` and `jest-dom` for testing that the `<App />` component renders "Welcome to React".

0 commit comments

Comments
 (0)