Files
element-plus/packages/test-utils/tick.ts
micaiguai 359440d411 refactor(test-utils): remove redundant code in tick.ts (#21903)
refactor(test-utils): remove redundant code

Co-authored-by: qiang <qw13131wang@gmail.com>
Co-authored-by: sea <45450994+warmthsea@users.noreply.github.com>
2025-12-23 09:14:11 +08:00

20 lines
382 B
TypeScript

import { nextTick } from 'vue'
const tick = async (times: number) => {
while (times--) {
await nextTick()
}
}
export default tick
// in order to test transitions, we need to use
// await rAF() after firing transition events.
export const rAF = async () => {
return new Promise((res) => {
requestAnimationFrame(() => {
requestAnimationFrame(res)
})
})
}