Skip to content
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

How to use Unistore action in JEST for shallow testing? #181

Open
MdAyman7 opened this issue Nov 27, 2019 · 2 comments
Open

How to use Unistore action in JEST for shallow testing? #181

MdAyman7 opened this issue Nov 27, 2019 · 2 comments

Comments

@MdAyman7
Copy link

MdAyman7 commented Nov 27, 2019

I am facing an error while testing my react app from JEST. It shows an error as "TypeError: Cannot read property 'action' of undefined".
Can I know how do I solve this error?

@MdAyman7 MdAyman7 changed the title How to test using Jest with Unistore? How to use Unistore action in JEST for shallow testing? Nov 27, 2019
@ashnehete
Copy link

I was facing the same error message. To solve it, I wrapped the Component around Provider.
mount(<Provider store={store}><Component /></Provider>)

@zgoda
Copy link

zgoda commented Mar 17, 2021

Unfortunately shallow(<Provider store={store}><ConnectionBox /></Provider>).debug() produces <i /> and I am not sure what I can do with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants