motion icon indicating copy to clipboard operation
motion copied to clipboard

Mocking rc-motion

Open prashantjainlacework opened this issue 3 years ago • 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.

prashantjainlacework avatar Mar 12 '22 00:03 prashantjainlacework

try this?


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

vagusX avatar Apr 27 '22 10:04 vagusX

try this?

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

how to config in vitest ?

edisonLzy avatar Apr 18 '24 04:04 edisonLzy