mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
refactor(test-utils): remove redundant code Co-authored-by: qiang <qw13131wang@gmail.com> Co-authored-by: sea <45450994+warmthsea@users.noreply.github.com>
20 lines
382 B
TypeScript
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)
|
|
})
|
|
})
|
|
}
|