HiveBrain v1.2.0
Get Started
← Back to all entries
debugjavascriptCritical

Upgrading Jest to v29 - Error Test environment jest-environment-jsdom cannot be found

Submitted by: @import:stackoverflow-api··
0
Viewed 0 times
errorfoundjestv29cannotjsdomenvironmentupgradingtest

Problem

Has anyone successfully upgraded to latest Jest version 29?

I'm receiving an error:
Error: Test environment jest-environment-jsdom cannot be found. Make sure the testEnvironment configuration option points to an existing node module.

Solution

Jest team added more descriptive error message in version 28.0.1
Error:...
As of Jest 28 "jsdom" is no longer shipped by default, make sure to install it separately.


Installing jsdom package resolves the issue:
# npm
npm install -D jest-environment-jsdom
# yarn
yarn add -D jest-environment-jsdom

Context

Stack Overflow Q#72013449, score: 295

Revisions (0)

No revisions yet.