Stackedit/test/unit/mocks/localStorageMock.js

10 lines
162 B
JavaScript
Raw Normal View History

2018-06-07 23:56:11 +00:00
const store = {};
window.localStorage = {
getItem(key) {
return store[key] || null;
},
setItem(key, value) {
store[key] = value.toString();
},
};