Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

redux-mock-store

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-mock-store - npm Package Compare versions

Comparing version 1.0.4 to 1.1.0

8

lib/index.js

@@ -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 @@

2

package.json
{
"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' };

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc