-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
unmockedModulePathPatterns not working? #551
Comments
I have issues with "unmockedModulePathPatterns": [
"react",
"react-dom",
"react-addons-test-utils"
] edit see #100 |
yes, node_modules are unmocked just by their name. |
I haven't been able to make any combination of syntax work. The only thing that works is jest.dontMock('react') or jest.autoMockOff(). Form Select component › it encountered a declaration exception
- TypeError: /home/nmartel/repos/UI-UNIT/node_modules/react/react.js: /home/nmartel/repos/UI-UNIT/node_modules/react/lib/React.js: /home/nmartel/repos/UI-UNIT/node_modules/react/lib/ReactDOM.js: /home/nmartel/repos/UI-UNIT/node_modules/react/lib/ReactDefaultInjection.js: /home/nmartel/repos/UI-UNIT/node_modules/react/lib/BeforeInputEventPlugin.js: Cannot read property 'topCompositionEnd' of undefined |
Are you using npm3? |
Yes. |
:( |
We need to fix this in jest! |
Well, at least I found out with that other thread that 'fbjs' needed to be unmocked too. Wasn't clear. |
Yep! We'll try to figure out a proper solution. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I need help figuring something out with unmockedModulePathPatterns.
From my package.json,
From the docs: An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them. Should I be using a different syntax inside my array. (Maybe like /react/) I've tried a bunch a combination, wasn't working.
If I don't include in my test jest.dontMock('react');, the mock always stays on. Is it normal? Using 0.5.10.
The text was updated successfully, but these errors were encountered: