Skip to content

How to write tests regarding Action Creators which return functions? #700

@rui-ktei

Description

@rui-ktei

It's mentioned in the documentation:

In Redux, action creators are functions which return plain objects. When testing action creators we want to test whether the correct action creator was called and also whether the right action was returned.

However, action creators can also return functions like this:

(dispatch, getState) => {...}

In this case, how do I write tests? It's not a simple checking object equality anymore.

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions