diff --git a/src/instrument.js b/src/instrument.js index a4abed96..a886b16a 100644 --- a/src/instrument.js +++ b/src/instrument.js @@ -337,7 +337,7 @@ export default function instrument(monitorReducer = () => null) { return createStore => (reducer, initialState, enhancer) => { function liftReducer(r) { if (typeof r !== 'function') { - throw new Error('Expected the nextReducer to be a function.') + throw new Error('Expected the nextReducer to be a function.'); } return liftReducerWith(r, initialState, monitorReducer); } diff --git a/test/instrument.spec.js b/test/instrument.spec.js index 9db18896..412d36db 100644 --- a/test/instrument.spec.js +++ b/test/instrument.spec.js @@ -322,4 +322,10 @@ describe('instrument', () => { expect(importMonitoredLiftedStore.getState()).toEqual(exportedState); }); }); + + it('throws if reducer is not a function', () => { + expect(() => + instrument()(createStore)() + ).toThrow('Expected the nextReducer to be a function.'); + }); });