2017-03-23 22:10:42 +00:00
|
|
|
import 'whatwg-fetch';
|
|
|
|
|
2018-06-25 17:42:50 +00:00
|
|
|
const localStorageMock = (function() {
|
2017-01-09 21:59:52 +00:00
|
|
|
let store = {};
|
|
|
|
|
|
|
|
return {
|
2018-06-25 17:42:50 +00:00
|
|
|
getItem(key) {
|
2017-03-03 20:09:08 +00:00
|
|
|
return store[key];
|
2017-01-09 21:59:52 +00:00
|
|
|
},
|
2018-06-25 17:42:50 +00:00
|
|
|
setItem(key, value) {
|
2017-03-03 20:09:08 +00:00
|
|
|
store[key] = value.toString();
|
2017-01-09 21:59:52 +00:00
|
|
|
},
|
2018-06-25 17:42:50 +00:00
|
|
|
clear() {
|
2017-03-03 20:09:08 +00:00
|
|
|
store = {};
|
2018-12-12 17:36:11 +00:00
|
|
|
},
|
2017-01-09 21:59:52 +00:00
|
|
|
};
|
|
|
|
})();
|
|
|
|
|
2017-11-26 20:45:40 +00:00
|
|
|
global.__DEV__ = false;
|
2017-01-09 21:59:52 +00:00
|
|
|
global.localStorage = localStorageMock;
|
2017-10-10 08:58:13 +00:00
|
|
|
global.requestAnimationFrame = cb => process.nextTick(cb);
|
2017-06-01 02:04:27 +00:00
|
|
|
global.require = require;
|
2017-11-27 15:52:35 +00:00
|
|
|
|
|
|
|
// Don't console log real logs that start with a tag (eg. [db] ...). It's annoying
|
|
|
|
const log = console.log;
|
|
|
|
global.console.log = (...args) => {
|
|
|
|
if (!(typeof args[0] === 'string' && args[0][0] === '[')) {
|
|
|
|
log(...args);
|
|
|
|
}
|
|
|
|
};
|