-
-
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
FileStub.js used for lodash modules :-( #1147
Comments
This appears to be related to #1145 |
I think I just ran into this: first time user, trying out
after changing the stock import React from 'react';
import { shallow } from 'enzyme';
import App from './App';
it('renders without crashing', () => {
shallow(<App/>);
}); as described here |
@tamouse, until this is fixed, you can downgrade to |
I've just published |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Can you reproduce the problem with latest npm?
Yes
Description
Due to this config for Jest,
lodash.<method-name>
modules are stubbed out astest-file-stub
. These are quite commonly used in common modules. For example,cheerio
(used byenzyme
) useslodash.assignin
for_.extend
behavior and because the regex used in the Jest config matcheslodash.
modules, it is mocked.Expected behavior
Don't mock modules which resolve to modules ending in
.js
Actual behavior
Mocks any modules referenced with a
.
in their name (even if they resolve to.js
modules via normal CommonJS resolution semantics).Environment
Mostly Irrelevant. I'm using v0.8.0 of
react-scripts
Reproducible Demo
Happy to make a demo if that's needed, but I think the issue is pretty clear. The solution... I think that we need to go back from a blacklist (like we have now) to a whitelist (like we had before)... Effectively reverting #1077 which was meant to address #667, but unfortunately had this pretty serious side-effect :-(
I imagine that considering
react-scripts
was released only about 10 hours ago, you'll start to see more and more people with this same issue. It would probably be good to get this fixed quickly to minimize impact.The text was updated successfully, but these errors were encountered: