From 71ab5c83c2a40f98604752ba67731670d88091e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=AE=A6=E6=88=90?= Date: Wed, 6 Apr 2022 13:37:11 +0800 Subject: [PATCH] fix: toBeInTheDocument is not a function fix when run jest with error "TypeError: expect(...).toBeInTheDocument is not a function" --- docs/testing.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/testing.md b/docs/testing.md index d24cd71f3249a9e..551933ad4d7d62f 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -439,6 +439,7 @@ For example, we can add a test to check if the `` component successfully import { render, screen } from '@testing-library/react' import Home from '../pages/index' +import '@testing-library/jest-dom' describe('Home', () => { it('renders a heading', () => {