Skip to content

Commit

Permalink
remove fake rafs
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed May 30, 2019
1 parent 601f157 commit 02f4bec
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,7 @@ describe('ChangeEventPlugin', () => {
ReactFeatureFlags = require('shared/ReactFeatureFlags');
// TODO pull this into helper method, reduce repetition.
// mock the browser APIs which are used in schedule:
// - requestAnimationFrame should pass the DOMHighResTimeStamp argument
// - calling 'window.postMessage' should actually fire postmessage handlers
global.requestAnimationFrame = function(cb) {
return setTimeout(() => {
cb(Date.now());
});
};
const originalAddEventListener = global.addEventListener;
let postMessageCallback;
global.addEventListener = function(eventName, callback, useCapture) {
Expand Down
4 changes: 0 additions & 4 deletions scripts/jest/setupEnvironment.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ global.__PROFILE__ = NODE_ENV === 'development';
global.__UMD__ = false;

if (typeof window !== 'undefined') {
global.requestAnimationFrame = function(callback) {
setTimeout(callback);
};

global.requestIdleCallback = function(callback) {
return setTimeout(() => {
callback({
Expand Down

0 comments on commit 02f4bec

Please sign in to comment.