mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
* chore: make tests compatible with Jest 24 * remove fake rafs * rollback jsdom for localstorage compat * Apply suggestions from code review Co-Authored-By: Sunil Pai <threepointone@oculus.com> * chore: cleanup lockfile
26 lines
639 B
JavaScript
26 lines
639 B
JavaScript
/* eslint-disable */
|
|
|
|
const NODE_ENV = process.env.NODE_ENV;
|
|
if (NODE_ENV !== 'development' && NODE_ENV !== 'production') {
|
|
throw new Error('NODE_ENV must either be set to development or production.');
|
|
}
|
|
global.__DEV__ = NODE_ENV === 'development';
|
|
global.__PROFILE__ = NODE_ENV === 'development';
|
|
global.__UMD__ = false;
|
|
|
|
if (typeof window !== 'undefined') {
|
|
global.requestIdleCallback = function(callback) {
|
|
return setTimeout(() => {
|
|
callback({
|
|
timeRemaining() {
|
|
return Infinity;
|
|
},
|
|
});
|
|
});
|
|
};
|
|
|
|
global.cancelIdleCallback = function(callbackID) {
|
|
clearTimeout(callbackID);
|
|
};
|
|
}
|