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.4.7 to 2.4.8

2

package.json
{
"name": "jest-localstorage-mock",
"version": "2.4.7",
"version": "2.4.8",
"description": "Auto mock all localstorage and sessionstorage APIs for your Jest tests",

@@ -5,0 +5,0 @@ "main": "dist/setup.js",

@@ -169,10 +169,11 @@ Use this module with [Jest](https://facebook.github.io/jest/) to run web tests

beforeEach(() => {
// values stored in tests will also be available in other tests unless you run
// to fully reset the state between tests, clear the storage
localStorage.clear();
// or directly reset the storage
// and reset all mocks
jest.clearAllMocks();
// clearAllMocks will impact your other mocks too, so you can optionally reset individual mocks instead:
localStorage.setItem.mockClear();
// you can also directly reset the storage (same as .clear above)
localStorage.__STORE__ = {};
// you could also reset all mocks, but this could impact your other mocks
jest.resetAllMocks();
// or individually reset a mock used
localStorage.setItem.mockClear();
});

@@ -179,0 +180,0 @@

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