redux-mock-store

Installation

You can install redux-mock-store via npm, we recommend installing the library as a dev dependency.

npm install redux-mock-store --save-dev

Usage

Synchronous action

The simplest usecase is for the synchronous actions. In this example, we will test if the addTodo action returns the right payload. redux-mock-store saves all the dispatched actions inside the store instance. You can get all the action by calling store.getActions(). Finally, you can use any assertion library to test the payload.