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

Examples for Unit Testing #2

Closed
tracker1 opened this issue Oct 28, 2018 · 3 comments
Closed

Examples for Unit Testing #2

tracker1 opened this issue Oct 28, 2018 · 3 comments

Comments

@tracker1
Copy link

Would be nice to see at least a simple example of unit testing this with jest or jest+enzyme.

aside: love this, hoping it comes to fruition.

@martynaskadisa
Copy link
Owner

Glad you like it! As for testing, I haven't given much of a thought for it yet as hooks are still a proposal.

One thing that comes to mind would be to wrap testing component with a provider in a test case.

const store = createMockStore();

const component = mount(
  <StoreContext.Provider value={store}>
    <TestingComponent />
  </StoreContext.Provider>
)

@martynaskadisa
Copy link
Owner

You might also be interested in following hooks discussion in react-redux repo here

@martynaskadisa
Copy link
Owner

I'm closing this as there is no point in using this library since react-redux supports hooks out the box.

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