import React from 'react'; import ConfigProvider from '..'; import { pureRender } from '../../../tests/utils'; let MotionProviderRun = 0; jest.mock('rc-motion', () => { const RcMotion = jest.requireActual('rc-motion'); const MotionProvider = RcMotion.Provider; return { ...RcMotion, Provider: (props: any) => { MotionProviderRun += 1; return ; }, }; }); describe('motion test', () => { beforeEach(() => { MotionProviderRun = 0; }); it('nest motion properties, should work fine', () => { pureRender( <> , ); expect(MotionProviderRun).toBe(3); }); });