Open rajzik opened 5 years ago
I personally haven't used Jest, but take a look at how npm installed the react-text-field
package in your node_modules directory. The @material/textfield
package could be nested inside @material/react-text-field/node_modules
directory.
Also not a regex expert, but I think the js
of "/node_modules/(?!@material).+\\.js$"
should be optional. Sometimes/most of the time we leave off .js
in the imports.
Yarn installed package under
node_modules/@material/textfield
.
So this regex "/node_modules/(?!@material).+\\.js$"
should work.
@rajzik have you figured out what regex worked for you?
@moog16 bad luck there, I did not. I have tried everything I could think of. Also I have tried everything from this thread https://github.com/facebook/jest/issues/6229, but this didn't work too.
have you tried https://github.com/facebook/create-react-app/issues/5241 - specifically inlining it as mentioned in this comment
I have the exact same issue here. Jest for a React app that uses Web Components made with Lit Element crashes on element's entry point.
I tried to test app which using @material/react-text-field with Create react app latest version available.
"@material/react-text-field": "^0.9.0"
Then I was trying to test with
yarn test
with following error:Steps to reproduce,
this App.tsx
And then run
Is there any workaround? I have tried to play with jest settings but I didn't figure it out.