admin管理员组

文章数量:1135117

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.

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.
Share Improve this question edited Sep 3, 2022 at 18:53 anon asked Apr 26, 2022 at 11:51 marko424marko424 5,2765 gold badges22 silver badges36 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 285

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

本文标签: javascriptUpgrading Jest to v29Error Test environment jestenvironmentjsdom cannot be foundStack Overflow