From 94c45f9b9c7b7b3b19b336320a259defe77c4166 Mon Sep 17 00:00:00 2001 From: Sakito Mukai Date: Sun, 2 Aug 2020 06:28:25 +0900 Subject: [PATCH] [Doc] fix React Testing Library example (#9245) --- docusaurus/docs/running-tests.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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(); }); ```