Skip to content

Commit f05465e

Browse files
bnewcombiansu
authored andcommitted
Update deprecated package reference (#7170)
* Update deprecated package reference * Fixed install method after feedback
1 parent 7548281 commit f05465e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docusaurus/docs/running-tests.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -180,21 +180,21 @@ As an alternative or companion to `enzyme`, you may consider using `react-testin
180180
To install `react-testing-library` and `jest-dom`, you can run:
181181

182182
```sh
183-
npm install --save react-testing-library jest-dom
183+
npm install --save @testing-library/react jest-dom
184184
```
185185

186186
Alternatively you may use `yarn`:
187187

188188
```sh
189-
yarn add react-testing-library jest-dom
189+
yarn add @testing-library/react jest-dom
190190
```
191191

192192
Similar to `enzyme` you can create a `src/setupTests.js` file to avoid boilerplate in your test files:
193193

194194
```js
195195
// react-testing-library renders your components to document.body,
196196
// this will ensure they're removed after each test.
197-
import 'react-testing-library/cleanup-after-each';
197+
import '@testing-library/react/cleanup-after-each';
198198
// this adds jest-dom's custom assertions
199199
import 'jest-dom/extend-expect';
200200
```
@@ -203,7 +203,7 @@ Here's an example of using `react-testing-library` and `jest-dom` for testing th
203203

204204
```js
205205
import React from 'react';
206-
import { render } from 'react-testing-library';
206+
import { render } from '@testing-library/react';
207207
import App from './App';
208208

209209
it('renders welcome message', () => {
@@ -212,7 +212,7 @@ it('renders welcome message', () => {
212212
});
213213
```
214214

215-
Learn more about the utilities provided by `react-testing-library` to facilitate testing asynchronous interactions as well as selecting form elements from [the `react-testing-library` documentation](https://testing-library.com/react) and [examples](https://codesandbox.io/s/github/kentcdodds/react-testing-library-examples).
215+
Learn more about the utilities provided by `react-testing-library` to facilitate testing asynchronous interactions as well as selecting form elements from the [`react-testing-library` documentation](https://testing-library.com/react) and [examples](https://codesandbox.io/s/github/kentcdodds/react-testing-library-examples).
216216

217217
## Using Third Party Assertion Libraries
218218

0 commit comments

Comments
 (0)