Skip to content

Commit

Permalink
test(mocks): add animation frame function mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
sabertazimi committed Aug 6, 2021
1 parent 330732d commit 93b4b48
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ Object.defineProperty(window, 'matchMedia', {
dispatchEvent: jest.fn(),
})),
});

window.requestAnimationFrame = function (callback) {
setTimeout(callback);
};

window.cancelAnimationFrame = window.clearTimeout;

0 comments on commit 93b4b48

Please sign in to comment.