Skip to content

Commit 3682534

Browse files
authored
docs: add jest-environment-jsdom package for Jest configuration (#36632)
## Documentation / Examples - [ ] Make sure the linting passes by running `yarn lint` Jest 28 does not include jest-environment-jsdom by default. following guide & running jest without jest-environment-jsdom causes the following error: <img width="1598" alt="image" src="https://user-images.githubusercontent.com/37980706/166319065-2bc29bb4-7d56-43e5-b85d-5a7484f17b1b.png">
1 parent fec5318 commit 3682534

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/testing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,10 @@ npx create-next-app@latest --example with-jest with-jest-app
263263

264264
Since the release of [Next.js 12](https://nextjs.org/blog/next-12), Next.js now has built-in configuration for Jest.
265265

266-
To set up Jest, install `jest` , `@testing-library/react`, `@testing-library/jest-dom`:
266+
To set up Jest, install `jest`, `jest-environment-jsdom`, `@testing-library/react`, `@testing-library/jest-dom`:
267267

268268
```bash
269-
npm install --save-dev jest @testing-library/react @testing-library/jest-dom
269+
npm install --save-dev jest jest-environment-jsdom @testing-library/react @testing-library/jest-dom
270270
```
271271

272272
Create a `jest.config.js` file in your project's root directory and add the following:

0 commit comments

Comments
 (0)