redux-router-location
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"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
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
123689
17
373
2
13
+ Added@types/lodash@^4.14.64
+ Added@types/lodash@4.17.10(transitive)