From d9a23566b4d9d35965a0d674ac81d109efb8bb15 Mon Sep 17 00:00:00 2001 From: abdallah akrab <37980706+akrabdev@users.noreply.github.com> Date: Mon, 2 May 2022 22:06:32 +0200 Subject: [PATCH] docs: add jest-environment-jsdom package for Jest configuration Jest 28 does not include jest-environment-jsdom by default --- docs/testing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/testing.md b/docs/testing.md index 551933ad4d7d6..11163588bbc55 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -263,10 +263,10 @@ npx create-next-app@latest --example with-jest with-jest-app Since the release of [Next.js 12](https://nextjs.org/blog/next-12), Next.js now has built-in configuration for Jest. -To set up Jest, install `jest` , `@testing-library/react`, `@testing-library/jest-dom`: +To set up Jest, install `jest`, `jest-environment-jsdom`, `@testing-library/react`, `@testing-library/jest-dom`: ```bash -npm install --save-dev jest @testing-library/react @testing-library/jest-dom +npm install --save-dev jest jest-environment-jsdom @testing-library/react @testing-library/jest-dom ``` Create a `jest.config.js` file in your project's root directory and add the following: