mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-04 21:51:17 +08:00
lint
This commit is contained in:
parent
2c99646fef
commit
4ca019ac02
@ -1,20 +1,18 @@
|
||||
const mock = () => {
|
||||
let storage = {};
|
||||
return {
|
||||
getItem: key => (key in storage ? storage[key] : null),
|
||||
setItem: (key, value) => (storage[key] = value || ''),
|
||||
removeItem: key => delete storage[key],
|
||||
clear: () => (storage = {})
|
||||
};
|
||||
let storage = {};
|
||||
return {
|
||||
getItem: key => (key in storage ? storage[key] : null),
|
||||
setItem: (key, value) => (storage[key] = value || ''),
|
||||
removeItem: key => delete storage[key],
|
||||
clear: () => (storage = {}),
|
||||
};
|
||||
|
||||
Object.defineProperty(window, 'localStorage', {
|
||||
value: mock()
|
||||
});
|
||||
Object.defineProperty(window, 'sessionStorage', {
|
||||
value: mock()
|
||||
});
|
||||
Object.defineProperty(window, 'getComputedStyle', {
|
||||
value: () => ['-webkit-appearance']
|
||||
});
|
||||
|
||||
};
|
||||
Object.defineProperty(window, 'localStorage', {
|
||||
value: mock(),
|
||||
});
|
||||
Object.defineProperty(window, 'sessionStorage', {
|
||||
value: mock(),
|
||||
});
|
||||
Object.defineProperty(window, 'getComputedStyle', {
|
||||
value: () => ['-webkit-appearance'],
|
||||
});
|
||||
|
@ -1,2 +1,2 @@
|
||||
import 'jest-preset-angular';
|
||||
import './globalMocks';
|
||||
import './globalMocks';
|
||||
|
Loading…
x
Reference in New Issue
Block a user