Files
react/scripts/jest/environment.js
Dan Abramov a27e4f3361 [Fiber] Make requestIdleCallback() and requestAnimationFrame() shims async (#8591)
* Add a failing test for recursion check

* Make requestIdleCallback() and requestAnimationFrame() shims async

They no longer need to be sync in tests because we already made DOM renderer sync by default.
This fixes a crash when testing incrementalness in DOM renderer itself.

* Style fix

* Fix lint
2016-12-21 14:04:05 -08:00

14 lines
287 B
JavaScript

/* eslint-disable */
global.__DEV__ = true;
// For testing DOM Fiber.
global.requestAnimationFrame = function(callback) {
setTimeout(callback);
};
global.requestIdleCallback = function(callback) {
setTimeout(() => {
callback({ timeRemaining() { return Infinity; } });
});
};