storage-mock
JSON →A cross-browser mock of the Web Storage API (localStorage and sessionStorage) that includes full support for the storage event, enabling testing of event listeners in environments like Node.js or headless browsers. The current version is 2.1.0, released with stable maintenance. It differentiates from simpler mocks by providing a complete window-like mock object that dispatches storage events on changes, making it suitable for testing event-driven code. The package is lightweight, has no dependencies, and supports Node.js >=4. It is primarily used in unit testing and CI/CD pipelines to simulate browser storage behavior.
Resources
packagestorage-mock ↗