Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mocking rc-motion #22

Open
prashantjainlacework opened this issue Mar 12, 2022 · 2 comments
Open

Mocking rc-motion #22

prashantjainlacework opened this issue Mar 12, 2022 · 2 comments

Comments

@prashantjainlacework
Copy link

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
Copy link
Member

vagusX commented Apr 27, 2022

try this?

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

@edisonLzy
Copy link

try this?

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

how to config in vitest ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants