有没有人成功升级到最新的 Jest 版本 28.0.0
?
我收到一个错误:
Error: Test environment jest-environment-jsdom cannot be found. Make sure the testEnvironment configuration option points to an existing node module.
最佳答案
Jest 团队添加了更多 descriptive error message在版本 28.0.1
Error: ...
As of Jest 28 "jsdom" is no longer shipped by default, make sure to install it separately.
安装 jsdom
包解决了这个问题:# npm
npm install -D jest-environment-jsdom
# yarn
yarn add -D jest-environment-jsdom
关于javascript - 将 Jest 升级到 v28 - 找不到错误测试环境 jest-environment-jsdom,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72013449/