12 lines
253 B
JavaScript
12 lines
253 B
JavaScript
export const useFakeRequestAnimationFrame = () => {
|
|
let orig;
|
|
|
|
beforeEach(() => {
|
|
orig = global.requestAnimationFrame;
|
|
global.requestAnimationFrame = (cb) => cb();
|
|
});
|
|
|
|
afterEach(() => {
|
|
global.requestAnimationFrame = orig;
|
|
});
|
|
};
|