14 lines
308 B
JavaScript
14 lines
308 B
JavaScript
|
// eslint-disable-next-line import/prefer-default-export
|
||
|
export const useFakeRequestAnimationFrame = () => {
|
||
|
let orig;
|
||
|
|
||
|
beforeEach(() => {
|
||
|
orig = global.requestAnimationFrame;
|
||
|
global.requestAnimationFrame = cb => cb();
|
||
|
});
|
||
|
|
||
|
afterEach(() => {
|
||
|
global.requestAnimationFrame = orig;
|
||
|
});
|
||
|
};
|