Tutorial by Examples

Redux is very functional, so unit testing is very straightforward. Action creator: export function showSidebar () { return { type: 'SHOW_SIDEBAR' } } Action creators unit test: import expect from 'expect' import actions from './actions' import * as type from './constants' desc...
import { expect } from 'chai'; import { createStore } from 'redux'; describe('redux store test demonstration', () => { describe('testReducer', () => { it('should increment value on TEST_ACTION', () => { // define a test reducer with initial state: test: 0 const te...

Page 1 of 1