2017-11-28 11:05:58 -05:00
|
|
|
/**
|
|
|
|
* Setup configuration for Jest
|
2017-12-03 05:14:17 -05:00
|
|
|
* This file includes global settings for the JEST environment.
|
2017-11-28 11:05:58 -05:00
|
|
|
*/
|
|
|
|
import 'raf/polyfill';
|
|
|
|
import { configure } from 'enzyme';
|
|
|
|
import Adapter from 'enzyme-adapter-react-16';
|
|
|
|
|
|
|
|
configure({ adapter: new Adapter() });
|
2018-07-21 13:49:10 -05:00
|
|
|
|
2018-08-01 08:00:39 -05:00
|
|
|
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();
|