August 2017
Beginner
374 pages
10h 41m
English
To be able to test reducers with asynchronous actions, we need to create a store with the thunk middleware. Furthermore, we also need to mock HTTP requests via nock;
npm install --save-dev nock
import { createStore, applyMiddleware } from 'redux'import thunk from 'redux-thunk'import nock from 'nock'
import { fetchUser } from '../../src/actions'import usersReducer from '../../src/reducers/users' ...Read now
Unlock full access