Socket
Socket
Sign inDemoInstall

redux-router-location

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-router-location - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

test/__snapshots__/actions.spec.ts.snap

8

package.json
{
"name": "redux-router-location",
"version": "0.1.0",
"version": "0.1.1",
"main": "index.js",

@@ -15,3 +15,3 @@ "repository": {

"build-stats": "NODE_ENV=production npm run clean && NODE_ENV=production webpack lib/index.js --json > stats.json",
"prepublish": "npm run build",
"prepare": "npm run build",
"test": "jest",

@@ -22,9 +22,11 @@ "test:watch": "yarn test -- --watch",

"dependencies": {
"@types/lodash": "^4.14.64",
"history": "^4.6.1"
},
"devDependencies": {
"@types/history": "^4.5.1",
"@types/jest": "^19.2.3",
"@types/history": "^4.5.1",
"cross-env": "^5.0.0",
"jest": "^20.0.4",
"lodash": "^4.17.4",
"redux": "^3.6.0",

@@ -31,0 +33,0 @@ "rimraf": "^2.5.4",

@@ -0,4 +1,54 @@

import { push, replace, go, goBack, goForward, locationDidChange } from '../src/actions';
import { Location } from 'history';
it('works', () => {
expect(2 + 2).toEqual(4);
function createLocation(path: string = ''): Location {
return {
pathname: path,
hash: '',
key: '0uicnx',
search: '',
state: null,
};
}
describe('actions', () => {
describe('push', () => {
it('create an push action', () => {
expect(push('/home')).toMatchSnapshot();
expect(push({ pathname: '/home', search: 'test' })).toMatchSnapshot();
});
});
describe('replace', () => {
it('create an replace action', () => {
expect(replace('/home')).toMatchSnapshot();
expect(replace({ pathname: '/home', search: 'test' })).toMatchSnapshot();
});
});
describe('go', () => {
it('create an go action', () => {
expect(go(3)).toMatchSnapshot();
});
});
describe('goBack', () => {
it('create an goBack action', () => {
expect(goBack()).toMatchSnapshot();
});
});
describe('goForward', () => {
it('create an goForward action', () => {
expect(goForward()).toMatchSnapshot();
});
});
describe('locationDidChange', () => {
it('create an locationDidChange action', () => {
expect(locationDidChange(createLocation('/home'))).toMatchSnapshot();
});
});
});

Sorry, the diff of this file is not supported yet

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