Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-localstorage-mock

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-localstorage-mock - npm Package Compare versions

Comparing version 2.2.0 to 2.3.0

__tests__/setup.test.js

26

dist/setup.js

@@ -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

31

package.json
{
"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

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