react-component/motion

Mocking rc-motion

Opened this issue · 2 comments

We are very badly stuck with testing our UI which is based on AntD. One problem we are facing is the Tree component which uses rc-motion to animate expand and collapse of a tree node.

Appreciate it you can please share a way to jest mock the rc-motion.

try this?

jest.mock('rc-motion/lib/util/motion', () => {
  return {
    ...jest.requireActual('rc-motion/lib/util/motion'),
    supportTransition: false,
  };
});

try this?

jest.mock('rc-motion/lib/util/motion', () => {
  return {
    ...jest.requireActual('rc-motion/lib/util/motion'),
    supportTransition: false,
  };
});

how to config in vitest ?