redux-mock-store
Advanced tools
Comparing version 1.0.4 to 1.1.0
@@ -36,2 +36,10 @@ 'use strict'; | ||
dispatch: function dispatch(action) { | ||
if (typeof action === 'undefined') { | ||
throw new Error('Actions may not be an undefined.'); | ||
} | ||
if (typeof action.type === 'undefined') { | ||
throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?'); | ||
} | ||
actions.push(action); | ||
@@ -38,0 +46,0 @@ |
{ | ||
"name": "redux-mock-store", | ||
"version": "1.0.4", | ||
"version": "1.1.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -27,2 +27,20 @@ import expect from 'expect'; | ||
it('should throw an error when action is undefined', () => { | ||
const store = mockStore({}); | ||
expect(() => { store.dispatch(undefined); }).toThrow( | ||
'Actions may not be an undefined.' | ||
); | ||
}); | ||
it('should throw an error when action type is undefined', () => { | ||
const action = { types: 'ADD_ITEM' }; | ||
const store = mockStore({}); | ||
expect(() => { store.dispatch(action); }).toThrow( | ||
'Actions may not have an undefined "type" property. ' + | ||
'Have you misspelled a constant?' | ||
); | ||
}); | ||
it('should return if the tests is successful', () => { | ||
@@ -29,0 +47,0 @@ const action = { type: 'ADD_ITEM' }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10033
181