-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Cannot find module 'react-test-renderer/package' from 'ReactSixteenAdapter.js' #2046
Comments
We had the same problem: https://travis-ci.com/alibaba-fusion/next/builds/104198552#L667 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Just freeze it to |
This shouldn’t break for anyone - node supports importing json files without an extension. If it’s not working, then your environment is broken. |
Adding |
Considering that's the default configuration of node itself, it's a bug in your jest configuration. @srittau if you remove your fix to your jest config, and change the import in the adapter to have an explicit |
@ljharb It does. I admit that it makes sense for enzyme to expect to be able to include things without extension, according to node's default configuration. I believe the root problem is that jest does not have an option to add to the default list of file extensions in We now opted to remove |
Either way, I'll close this issue by explicitly adding the extension, since that seems to be the best compromise. |
Current behavior
Cannot find module 'react-test-renderer/package' from 'ReactSixteenAdapter.js'
Broke in 98154a9
Changing the import from:
import { version as testRendererVersion } from 'react-test-renderer/package';
to
import { version as testRendererVersion } from 'react-test-renderer';
Solves the issue for me.
Expected behavior
No error...
Your environment
API
Version
Adapter
The text was updated successfully, but these errors were encountered: