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.2 to 1.0.3

index.d.ts

10

lib/index.js

@@ -24,2 +24,3 @@ 'use strict';

var actions = [];
var listeners = [];

@@ -38,2 +39,6 @@ var self = {

for (var i = 0; i < listeners.length; i++) {
listeners[i]();
}
return action;

@@ -46,3 +51,6 @@ },

subscribe: function subscribe() {
subscribe: function subscribe(cb) {
if (isFunction(cb)) {
listeners.push(cb);
}
return null;

@@ -49,0 +57,0 @@ }

3

package.json
{
"name": "redux-mock-store",
"version": "1.0.2",
"version": "1.0.3",
"description": "",
"main": "lib/index.js",
"typings": "./index.d.ts",
"scripts": {

@@ -7,0 +8,0 @@ "prepublish": "rimraf lib && babel src --out-dir lib",

@@ -43,3 +43,3 @@ [![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)

// Promise test example with mocha and expect
it('should execute promise', (done) => {
it('should execute promise', () => {
function success() {

@@ -60,6 +60,6 @@ return {

store.dispatch(fetchData())
// Return the promise
return store.dispatch(fetchData())
.then(() => {
expect(store.getActions()[0]).toEqual(success())
done();
});

@@ -78,2 +78,3 @@ })

- store.clearActions()
- store.subscribe()
```

@@ -80,0 +81,0 @@

@@ -107,7 +107,12 @@ import expect from 'expect';

it('has empty subscribe method', () => {
it('subscribes to dispatched actions', (done) => {
const store = mockStore();
expect(store.subscribe()).toEqual(null);
const action = { type: 'ADD_ITEM' };
store.subscribe(() => {
expect(store.getActions()[0]).toEqual(action);
done();
});
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