From a3d053880c1a9846f5fcacff55be9046b202e4d4 Mon Sep 17 00:00:00 2001 From: Zalmoxisus Date: Sat, 30 Jan 2016 15:52:01 +0200 Subject: [PATCH] Add a test for 'Expected the nextReducer to be a function.' and fix ESLint --- src/instrument.js | 2 +- test/instrument.spec.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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.'); + }); });