insomnia/app/__jest__/setup.js

18 lines
284 B
JavaScript
Raw Normal View History

const localStorageMock = (function () {
let store = {};
return {
getItem (key) {
return store[key];
},
setItem (key, value) {
store[key] = value.toString();
},
clear () {
store = {};
}
};
})();
global.localStorage = localStorageMock;