Skip to content

Testing thunks #1162

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

Closed
henrybaxter opened this issue Dec 20, 2015 · 2 comments
Closed

Testing thunks #1162

henrybaxter opened this issue Dec 20, 2015 · 2 comments

Comments

@henrybaxter
Copy link

I have dead simple pure actions and reducers. The majority of my 'business logic' is in async action thunks (using just redux-thunk). I am testing these (using expect & mocha). It's good, but I ran into a repetitive pattern: 1) setup preconditions, 2) run the action, 3) review the pure actions that resulted.

What is a good way to review these pure actions that resulted? store.subscribe(...) gives access to the state, but I want a trail of actions. I thought of middleware, but that means modifying the way my middleware chain works and using a different configureStore type function only for testing. Is that the best way?

Edit: I realize this is a question/discussion, and would be happy to move it to a better place than an issue.

@henrybaxter
Copy link
Author

#546 answers this, sorry for the noise.

@henrybaxter
Copy link
Author

And the recipes

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

1 participant