diff --git a/docusaurus/docs/running-tests.md b/docusaurus/docs/running-tests.md index 14244ae275e..98ea1b46273 100644 --- a/docusaurus/docs/running-tests.md +++ b/docusaurus/docs/running-tests.md @@ -201,12 +201,12 @@ Here's an example of using `react-testing-library` and `jest-dom` for testing th ```js import React from 'react'; -import { render } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; import App from './App'; it('renders welcome message', () => { - const { getByText } = render(); - expect(getByText('Learn React')).toBeInTheDocument(); + render(); + expect(screen.getByText('Learn React')).toBeInTheDocument(); }); ```