Skip to content

Commit

Permalink
fix: toBeInTheDocument is not a function (vercel#35930)
Browse files Browse the repository at this point in the history
fix when run jest with error "TypeError: expect(...).toBeInTheDocument is not a function"



![image](https://user-images.githubusercontent.com/13283837/161903133-501f6f6b-8623-4b1f-986f-0faa32b3ef91.png)

## Feature
- [x] Documentation added

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
  • Loading branch information
bestony authored and colinhacks committed Apr 14, 2022
1 parent 5da62fa commit 853cee4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/testing.md
Expand Up @@ -439,6 +439,7 @@ For example, we can add a test to check if the `<Home />` 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', () => {
Expand Down

0 comments on commit 853cee4

Please sign in to comment.