-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
TypeError: Cannot read property 'actionTypes' of undefined #973
Comments
Pushed a branch The only way to overcome this issue is to do a complete manual mock on the
see the above in the |
It's likely because your setup is slightly wrong: https://github.com/andrewmclagan/jest-react-example/blob/no-stage-0/package.json#L22 here you should add a slash at the end: Happy to reopen if this doesn't turn out to be the actual issue. |
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. |
This is possibly related related to
babel-jest
settings, although I'm unable to debug the issue.When importing a react component
redux-form
we are receiving the following error in our test:Following the stack trace to
/--REDACTED--/jest-react-example/node_modules/redux-form/lib/index.js:22:29
its seems jest is having trouble mocking this components code.We have setup a repository to replicate this issue: https://github.com/andrewmclagan/jest-react-example.
You will notice that we are not testing
reduxForm
we are exporting two things from ourFormComponent
file: an isolated component and theredux-form
component. Currently from the docs its not clear how to deal withdefault
es6 exports. Really we only want to test the isolated component.As the component actually functions we are assuming its Jest related?
The text was updated successfully, but these errors were encountered: