August 2017
Beginner
374 pages
10h 41m
English
To be able to test asynchronous action creators, we need to mock the Redux store via redux-mock-store. The mock store will create an array of dispatched actions, which serves as an action log for our tests. Like in the previous section, we also mock the HTTP requests via nock:
npm install --save-dev redux-mock-store
import configureMockStore from 'redux-mock-store'import thunk from 'redux-thunk'import nock from 'nock'
Read now
Unlock full access