jest-localstorage-mock
Advanced tools
Comparing version 2.2.0 to 2.3.0
@@ -40,13 +40,31 @@ 'use strict'; | ||
get length() { | ||
return Object.keys(this).length; | ||
} | ||
// for backwards compatibility | ||
} // for backwards compatibility | ||
get __STORE__() { | ||
return this; | ||
} | ||
} | ||
global.localStorage = new LocalStorage(jest); | ||
global.sessionStorage = new LocalStorage(jest); | ||
if (typeof global._localStorage !== 'undefined') { | ||
Object.defineProperty(global, '_localStorage', { | ||
value: new LocalStorage(jest), | ||
writable: false | ||
}); | ||
} else { | ||
global.localStorage = new LocalStorage(jest); | ||
} | ||
if (typeof global._sessionStorage !== 'undefined') { | ||
Object.defineProperty(global, '_sessionStorage', { | ||
value: new LocalStorage(jest), | ||
writable: false | ||
}); | ||
} else { | ||
global.sessionStorage = new LocalStorage(jest); | ||
} | ||
//# sourceMappingURL=setup.js.map |
{ | ||
"name": "jest-localstorage-mock", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "Auto mock all localstorage and sessionstorage APIs for your Jest tests", | ||
@@ -30,6 +30,6 @@ "main": "dist/setup.js", | ||
"homepage": "https://github.com/clarkbw/jest-localstorage-mock", | ||
"license": "ISC", | ||
"license": "BSD-3-Clause", | ||
"licenses": [ | ||
{ | ||
"type": "ISC" | ||
"type": "BSD-3-Clause" | ||
} | ||
@@ -52,3 +52,5 @@ ], | ||
"scripts": { | ||
"test": "jest", | ||
"test": "yarn test:node && yarn test:jsdom", | ||
"test:node": "jest --env=node", | ||
"test:jsdom": "jest --env=jsdom", | ||
"build": "rollup -c", | ||
@@ -60,19 +62,18 @@ "prettier": "prettier --single-quote --trailing-comma es5 --write \"{src,__{tests,setups}__}/**/*.js\" README.md CONTRIBUTING.md *.json rollup.config.js", | ||
"devDependencies": { | ||
"babel-core": "^6.26.0", | ||
"babel-jest": "^22.0.0", | ||
"babel-plugin-external-helpers": "^6.22.0", | ||
"babel-preset-env": "^1.6.1", | ||
"eslint": "^4.10.0", | ||
"eslint-config-prettier": "^2.7.0", | ||
"eslint-plugin-prettier": "^2.3.1", | ||
"jest": "^22.0.0", | ||
"@babel/core": "^7.1.2", | ||
"@babel/plugin-external-helpers": "^7.0.0", | ||
"@babel/preset-env": "^7.1.0", | ||
"babel-core": "^7.0.0-bridge.0", | ||
"babel-jest": "*", | ||
"jest": "*", | ||
"prettier": "^1.8.2", | ||
"rollup": "^0.54.0", | ||
"rollup-plugin-babel": "^3.0.0", | ||
"rollup": "^0.66.6", | ||
"rollup-plugin-babel": "^4.0.3", | ||
"rollup-plugin-node-resolve": "^3.0.0" | ||
}, | ||
"engines": { | ||
"node": ">=6.11.3" | ||
"node": ">=6.14.0" | ||
}, | ||
"jest": { | ||
"testURL": "http://localhost/", | ||
"bail": true, | ||
@@ -79,0 +80,0 @@ "coverageDirectory": "./coverage/", |
@@ -11,14 +11,2 @@ import resolve from 'rollup-plugin-node-resolve'; | ||
babelrc: false, | ||
presets: [ | ||
[ | ||
'env', | ||
{ | ||
targets: { | ||
node: '6.11.3', | ||
}, | ||
modules: false, | ||
}, | ||
], | ||
], | ||
plugins: ['external-helpers'], | ||
}), | ||
@@ -25,0 +13,0 @@ ], |
import { LocalStorage } from './localstorage'; | ||
global.localStorage = new LocalStorage(jest); | ||
global.sessionStorage = new LocalStorage(jest); | ||
if (typeof global._localStorage !== 'undefined') { | ||
Object.defineProperty(global, '_localStorage', { | ||
value: new LocalStorage(jest), | ||
writable: false, | ||
}); | ||
} else { | ||
global.localStorage = new LocalStorage(jest); | ||
} | ||
if (typeof global._sessionStorage !== 'undefined') { | ||
Object.defineProperty(global, '_sessionStorage', { | ||
value: new LocalStorage(jest), | ||
writable: false, | ||
}); | ||
} else { | ||
global.sessionStorage = new LocalStorage(jest); | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
210625
10
18
0
309