react-component / motion

⛷ CSS Animation for React
https://motion-seven.vercel.app
MIT License
143 stars 38 forks source link

Mocking rc-motion #22

Open prashantjainlacework opened 2 years ago

prashantjainlacework commented 2 years ago

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.

vagusX commented 2 years ago

try this?


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

try this?

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

how to config in vitest ?