Stackedit/test/unit/mocks/localStorageMock.js
Benoit Schweblin e05e7717eb Added tests
2018-06-07 23:56:11 +00:00

10 lines
162 B
JavaScript

const store = {};
window.localStorage = {
getItem(key) {
return store[key] || null;
},
setItem(key, value) {
store[key] = value.toString();
},
};