mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-28 20:43:56 +03:00
Add a test for 'Expected the nextReducer to be a function.' and fix ESLint
This commit is contained in:
parent
d756384b6c
commit
a3d053880c
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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.');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user