Skip to content

Commit a3d0538

Browse files
committed
Add a test for 'Expected the nextReducer to be a function.' and fix ESLint
1 parent d756384 commit a3d0538

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/instrument.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ export default function instrument(monitorReducer = () => null) {
337337
return createStore => (reducer, initialState, enhancer) => {
338338
function liftReducer(r) {
339339
if (typeof r !== 'function') {
340-
throw new Error('Expected the nextReducer to be a function.')
340+
throw new Error('Expected the nextReducer to be a function.');
341341
}
342342
return liftReducerWith(r, initialState, monitorReducer);
343343
}

test/instrument.spec.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,4 +322,10 @@ describe('instrument', () => {
322322
expect(importMonitoredLiftedStore.getState()).toEqual(exportedState);
323323
});
324324
});
325+
326+
it('throws if reducer is not a function', () => {
327+
expect(() =>
328+
instrument()(createStore)()
329+
).toThrow('Expected the nextReducer to be a function.');
330+
});
325331
});

0 commit comments

Comments
 (0)