Skip to content

Testing thunks #1162

Closed
Closed
@henrybaxter

Description

@henrybaxter

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions