blob: 5486d7c9a0a3f16bd79ed38b285d50e59d2493a2 [file] [log] [blame]
Ittay Stern6f900cc2018-08-29 17:01:32 +03001const mock = () => {
2 let storage = {};
3 return {
4 getItem: key => key in storage ? storage[key] : null,
5 setItem: (key, value) => storage[key] = value || '',
6 removeItem: key => delete storage[key],
7 clear: () => storage = {},
8 };
9};
10
11Object.defineProperty(window, 'localStorage', {value: mock()});
12Object.defineProperty(window, 'sessionStorage', {value: mock()});
13Object.defineProperty(window, 'getComputedStyle', {
14 value: () => ['-webkit-appearance']
15});