-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
npm test fails with assets imported from node_modules folder #579
Comments
On further investigation this appears to be a problem with scopes. We are publishing packages to a private npm server and use scoping to avoid any clashes and to indicate this is a special package. So a sample package name may be:
https://docs.npmjs.com/private-modules/intro#setting-up-your-package When you Further tests show it's that pesky @ sign that seems to break Jest. If I remove it from the folder name in node_modules then it will work OK. |
Can you please file this in Jest repo and link to this issue? Thank you! |
cc @cpojer |
The problem seems to be in the |
Thanks @fson! |
This should be fixed in 0.4.2. |
Hi, apologies for commenting on such an old issue, but I seem to be having a similar issue as I reported in #4262. Is this related and a regression? The |
I have published a number of in-house components that package up CSS and images so they can be included in a Webpack project like this:
This has worked great with CRA and my apps run and build correctly.
However, any attempt to test code that includes CSS/images in this way with CRA 0.4.1 will fail - almost as if testing treats anything imported from
node_modules
as JavaScript.e.g. when running a test of a component that imports a PNG from node_modules/my-component/img:
Any ideas or workarounds would be welcome.
The text was updated successfully, but these errors were encountered: