2017-03-23 22:10:42 +00:00
|
|
|
import 'whatwg-fetch';
|
|
|
|
|
2017-01-09 21:59:52 +00:00
|
|
|
const localStorageMock = (function () {
|
|
|
|
let store = {};
|
|
|
|
|
|
|
|
return {
|
2017-03-03 20:09:08 +00:00
|
|
|
getItem (key) {
|
|
|
|
return store[key];
|
2017-01-09 21:59:52 +00:00
|
|
|
},
|
2017-03-03 20:09:08 +00:00
|
|
|
setItem (key, value) {
|
|
|
|
store[key] = value.toString();
|
2017-01-09 21:59:52 +00:00
|
|
|
},
|
2017-03-03 20:09:08 +00:00
|
|
|
clear () {
|
|
|
|
store = {};
|
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);
|
|
|
|
}
|
|
|
|
};
|