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

Redux Provider and set context #1013

Closed
heinhoang opened this issue Jun 27, 2017 · 2 comments
Closed

Redux Provider and set context #1013

heinhoang opened this issue Jun 27, 2017 · 2 comments

Comments

@heinhoang
Copy link

I have a component with context, I test like this:

const context = {a: "b"};
mount(<Login />, context);

it works.
but I wrap by Provider. It not work:

import configureStore from 'redux-mock-store';
const context = {a: "b"};
const store = mockStore();
mount(<Provider store={store}><Login /></Provider>, context);

How to fix

@ljharb
Copy link
Member

ljharb commented Jun 27, 2017

Generally Providers provide context; so they'd ignore the context you set in mount.

@ljharb
Copy link
Member

ljharb commented Feb 26, 2019

#664 should address this, along with #1960.

@ljharb ljharb closed this as completed Feb 26, 2019
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

2 participants