Skip to content

Commit 94c45f9

Browse files
authored
[Doc] fix React Testing Library example (facebook#9245)
1 parent d449f9d commit 94c45f9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docusaurus/docs/running-tests.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,12 @@ Here's an example of using `react-testing-library` and `jest-dom` for testing th
201201

202202
```js
203203
import React from 'react';
204-
import { render } from '@testing-library/react';
204+
import { render, screen } from '@testing-library/react';
205205
import App from './App';
206206

207207
it('renders welcome message', () => {
208-
const { getByText } = render(<App />);
209-
expect(getByText('Learn React')).toBeInTheDocument();
208+
render(<App />);
209+
expect(screen.getByText('Learn React')).toBeInTheDocument();
210210
});
211211
```
212212

0 commit comments

Comments
 (0)