2020-07-16 06:09:33 +00:00
|
|
|
export const useFakeRequestAnimationFrame = () => {
|
|
|
|
let orig;
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
orig = global.requestAnimationFrame;
|
2020-12-23 21:10:24 +00:00
|
|
|
global.requestAnimationFrame = (cb) => cb();
|
2020-07-16 06:09:33 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(() => {
|
|
|
|
global.requestAnimationFrame = orig;
|
|
|
|
});
|
|
|
|
};
|