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.1.2 to 1.1.3

8

lib/index.js

@@ -61,3 +61,9 @@ 'use strict';

}
return null;
return function () {
var index = listeners.indexOf(cb);
if (index < 0) {
return;
}
listeners.splice(index, 1);
};
}

@@ -64,0 +70,0 @@ };

2

package.json
{
"name": "redux-mock-store",
"version": "1.1.2",
"version": "1.1.3",
"description": "",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -33,6 +33,6 @@ [![Circle CI](https://circleci.com/gh/arnaudbenard/redux-mock-store/tree/master.svg?style=svg)](https://circleci.com/gh/arnaudbenard/redux-mock-store/tree/master)

it('should dispatch action', () => {
const getState = {}; // initial state of the store
const initialState = {};
const addTodo = { type: 'ADD_TODO' };
const store = mockStore(getState);
const store = mockStore(initialState);
store.dispatch(addTodo);

@@ -39,0 +39,0 @@

@@ -130,3 +130,3 @@ import expect from 'expect';

const action = { type: 'ADD_ITEM' };
store.subscribe(() => {

@@ -138,2 +138,20 @@ expect(store.getActions()[0]).toEqual(action);

});
it('can unsubscribe subscribers', function (done) {
const store = mockStore();
const action = { type: 'ADD_ITEM' };
const waitForMS = 25;
const testWaitsAnotherMS = 25;
this.timeout(waitForMS + testWaitsAnotherMS);
const timeoutId = setTimeout(done, waitForMS);
const unsubscribe = store.subscribe(() => {
clearTimeout(timeoutId);
done(new Error('should never be called'));
});
unsubscribe();
store.dispatch(action);
});
});
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