insomnia/app/__jest__/setup.js
2017-07-19 21:02:42 -07:00

21 lines
334 B
JavaScript

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