1
votes

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
at 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

Versions from package.json:
enzyme version: 3.10.0
react version: 16.11.0
react-dom version: 16.11.0
react-test-renderer version: 16.11.1
enzyme-adapter-react-16 version: 1.11.2

1
can watch this issue on github github issueRoei Rom
It's hard to tell from this context. Can you post the code that generates the error? If this is occurring in a custom component you've written and don't want to post, I often find it helpful to try to recreate the error in a simple project that can be easily posted.Dan Monego

1 Answers

1
votes

I needed to wrap the tested component with the material UI theme provider.