stackedit/test/unit/mocks/localStorageMock.js

10 lines
162 B
JavaScript
Raw Normal View History

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