Skip to content

Commit 7ceccf8

Browse files
committed
fix: make validation assertion return void
1 parent 5672327 commit 7ceccf8

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/utilities/validateNextState.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
export default (nextState, reducerName: string, action: Object): null => {
1+
export default (nextState, reducerName: string, action: Object): void => {
22
// eslint-disable-next-line no-undefined
33
if (nextState === undefined) {
44
throw new Error('Reducer "' + reducerName + '" returned undefined when handling "' + action.type + '" action. To ignore an action, you must explicitly return the previous state.');
55
}
6-
7-
return null;
86
};

tests/utilities/validateNextState.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ describe('utilities', () => {
1919
});
2020
});
2121
context('state is defined', () => {
22-
it('returns null', () => {
22+
it('returns undefined', () => {
2323
const result = validateNextState(Immutable.Map(), 'reducer name', {
2424
type: 'foo'
2525
});
2626

27-
expect(result).to.equal(null);
27+
// eslint-disable-next-line no-undefined
28+
expect(result).to.equal(undefined);
2829
});
2930
});
3031
});

0 commit comments

Comments
 (0)