mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-11-13 03:35:52 +01:00
dc9460ff07
* refactor: improves <Header /> component test cases * refactor: adds destructuring for state in render block
35 lines
620 B
JavaScript
35 lines
620 B
JavaScript
/**
|
|
* Setup configuration for Jest
|
|
* This file includes global settings for the JEST environment.
|
|
*/
|
|
import 'raf/polyfill';
|
|
import { configure } from 'enzyme';
|
|
import Adapter from 'enzyme-adapter-react-16';
|
|
|
|
configure({ adapter: new Adapter() });
|
|
|
|
global.__APP_VERSION__ = '1.0.0';
|
|
|
|
class LocalStorageMock {
|
|
constructor() {
|
|
this.store = {};
|
|
}
|
|
|
|
clear() {
|
|
this.store = {};
|
|
}
|
|
|
|
getItem(key) {
|
|
return this.store[key] || null;
|
|
}
|
|
|
|
setItem(key, value) {
|
|
this.store[key] = value.toString();
|
|
}
|
|
|
|
removeItem(key) {
|
|
delete this.store[key];
|
|
}
|
|
}
|
|
|
|
global.localStorage = new LocalStorageMock(); |