jasmine-local-storage

JSON →
library 1.1.2 ·javascript maintenance
verified Jun 7, 2026

Mock localStorage in Jasmine 2.x tests. Version 1.1.2 is the latest stable, compatible with Jasmine >=2 and <5. It provides simple `mockLocalStorage()` and `unmockLocalStorage()` functions that replace the global localStorage with a spy-based mock, allowing assertions on calls like `setItem`, `getItem`, etc. Unlike full localStorage polyfills, this package integrates directly with Jasmine's spy framework, enabling call-count checks and clean state between tests. Low maintenance; last release 2021.