[英]TypeError: Cannot read property 'create' of undefined (Material UI/enzyme)
What I get when I mount a component, (with shallow I dont get this error) I get the following error.安装组件时得到的结果(浅我没有收到此错误)我收到以下错误。
TypeError: Cannot read property 'create' of undefined TypeError:无法读取未定义的属性“创建”
at stylesOrCreator (node_modules/@material-ui/core/CircularProgress/CircularProgress.js在 stylesOrCreator (node_modules/@material-ui/core/CircularProgress/CircularProgress.js
. .
. .
. .
get also this error on top:在顶部也得到这个错误:
node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/virtual-console.js Uncaught TypeError: Cannot read property 'body2' of undefined node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/virtual-console.js 未捕获类型错误:无法读取未定义的属性“body2”
Versions from package.json: package.json 的版本:
enzyme version: 3.10.0酶版本:3.10.0
react version: 16.11.0反应版本:16.11.0
react-dom version: 16.11.0反应域版本:16.11.0
react-test-renderer version: 16.11.1反应测试渲染器版本:16.11.1
enzyme-adapter-react-16 version: 1.11.2酶适配器反应 16 版本:1.11.2
I needed to wrap the tested component with the material UI theme provider.我需要使用材质 UI 主题提供程序来包装测试组件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.