Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): Add Jest 28 jest-environment-jsdom information #35904

Merged
merged 3 commits into from Jun 13, 2022
Merged

chore(docs): Add Jest 28 jest-environment-jsdom information #35904

merged 3 commits into from Jun 13, 2022

Conversation

jonrutter
Copy link
Contributor

Add missing information about installation in the Testing React Components page.

Description

The documentation for Testing React Components has incomplete information about installation when using the latest version of Jest.

The documentation mentions that for Jest 27, you need to set the testEnvironment in jest.config.js to jsdom, in order for React Testing Library to work properly. However, Jest 28 removed the jest-environment-jsdom module, so you now need to install it separately if you are using Jest 28 or higher (as confirmed by the react-testing-library docs). As a result, if you are using Jest 28 and follow the installation instructions, you will get an error when you try to run your tests.

This PR gives instructions to install the jest-environment-jsdom package separately if using Jest 28.

Add information about needing to install jest-environment-jsdom for Jest v28
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jun 9, 2022
@LekoArts LekoArts added type: documentation An issue or pull request for improving or updating Gatsby's documentation and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jun 13, 2022
@LekoArts LekoArts changed the title Add missing information about installation in the Testing React Components page chore(docs): Add Jest 28 jest-environment-jsdom information Jun 13, 2022
Copy link
Contributor

@LekoArts LekoArts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@LekoArts LekoArts merged commit 96a18c9 into gatsbyjs:master Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation An issue or pull request for improving or updating Gatsby's documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants