mirror of
https://github.com/youzan/vant.git
synced 2025-10-18 01:17:15 +00:00
chore: adjust path of test utils (#4997)
This commit is contained in:
26
test/index.ts
Normal file
26
test/index.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import Vue from 'vue';
|
||||
import './transition';
|
||||
import { mount, TransitionStub } from '@vue/test-utils';
|
||||
import { trigger, triggerDrag } from './event';
|
||||
import { mockScrollTop, mockGetBoundingClientRect } from './dom';
|
||||
|
||||
// prevent vue warning log
|
||||
Vue.config.silent = true;
|
||||
|
||||
// stub transition
|
||||
Vue.component('transition', TransitionStub as any);
|
||||
|
||||
// promisify setTimeout
|
||||
export function later(delay: number = 0): Promise<void> {
|
||||
return new Promise(resolve => {
|
||||
setTimeout(resolve, delay);
|
||||
});
|
||||
}
|
||||
|
||||
export {
|
||||
mount,
|
||||
trigger,
|
||||
triggerDrag,
|
||||
mockScrollTop,
|
||||
mockGetBoundingClientRect
|
||||
};
|
Reference in New Issue
Block a user