mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-30 06:09:34 +08:00
c979850a5b
* test: ✅ test menu and collapse motion
* chore: move openAnimation into collapse
* add test case
* rm extra openAnimation.tsx
* remove unused code
19 lines
426 B
TypeScript
19 lines
426 B
TypeScript
import MockDate from 'mockdate';
|
|
import { act } from 'react-dom/test-utils';
|
|
|
|
export function setMockDate(dateString = '2017-09-18T03:30:07.795') {
|
|
MockDate.set(dateString);
|
|
}
|
|
|
|
export function resetMockDate() {
|
|
MockDate.reset();
|
|
}
|
|
|
|
const globalTimeout = global.setTimeout;
|
|
|
|
export const sleep = async (timeout = 0) => {
|
|
await act(async () => {
|
|
await new Promise(resolve => globalTimeout(resolve, timeout));
|
|
});
|
|
};
|