You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
375 B
22 lines
375 B
import 'jsdom-global/register';
|
|
|
|
// browserMocks.js
|
|
const localStorageMock = (() => {
|
|
let store = {};
|
|
|
|
return {
|
|
getItem(key) {
|
|
return store[key] || null;
|
|
},
|
|
setItem(key, value) {
|
|
store[key] = value.toString();
|
|
},
|
|
clear() {
|
|
store = {};
|
|
},
|
|
};
|
|
})();
|
|
|
|
Object.defineProperty(window, 'localStorage', {
|
|
value: localStorageMock,
|
|
});
|
|
|