blob: 9e56d6dd77d443ecdcc97066175e25bcbc5622e3 [file] [log] [blame]
ys969316a9fce2020-01-19 13:50:02 +02001const 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
11 Object.defineProperty(window, 'localStorage', { value: mock() });
12 Object.defineProperty(window, 'sessionStorage', { value: mock() });
13 Object.defineProperty(window, 'getComputedStyle', {
14 value: () => ['-webkit-appearance'],
15
16 });