-
-
Notifications
You must be signed in to change notification settings - Fork 190
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 'getState' of undefined (Testing with Jest & Enzyme) #438
Comments
Hey @szmarci Sorry, I use |
Hey @ctrlplusb |
You are likely facing this restriction: |
Hi @szmarci, |
I have similar issue, that I converted all .ts file to .js file in my project (Type script to java script), and while unit testing getting error as " cannot read property getState of undefined", While wrapping the testing component with "Provider store={store}" Does anybody know the issue..? |
I'm trying to test a component with Jest and Enzyme, like this:
I'm trying to mock out the store with an initial state, then supplying it to
StoreProvider
.Tab component is hooking into the state like this:
The error is thrown at the
useStoreState
line:TypeError: Cannot read property 'getState' of undefined
Is this something I am missing or this is not supposed to work like that?
The text was updated successfully, but these errors were encountered: