chore: adjust path of test utils (#4997)

This commit is contained in:
neverland 2019-11-13 16:46:01 +08:00 committed by GitHub
parent 4cd132c0ee
commit aee1091c5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
125 changed files with 231 additions and 220 deletions

View File

@ -2,9 +2,9 @@ module.exports = {
moduleFileExtensions: ['js', 'jsx', 'vue', 'ts', 'tsx'],
transform: {
'\\.(vue)$': 'vue-jest',
'\\.(js|jsx|ts|tsx)$': '<rootDir>/test/jest.transform.js',
'\\.(js|jsx|ts|tsx)$': '<rootDir>/test/transformer.js',
},
snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],
snapshotSerializers: ['jest-serializer-vue'],
collectCoverageFrom: [
'src/**/*.{js,jsx,ts,tsx,vue}',
'!**/style/**',

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,4 +1,4 @@
import { mount, later } from '../../../test/utils';
import { mount, later } from '../../../test';
import ActionSheet from '..';
test('callback events', () => {

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,6 +1,6 @@
import AddressEdit from '..';
import areaList from '../../area/demo/area.simple';
import { mount, later } from '../../../test/utils';
import { mount, later } from '../../../test';
const addressInfo = {
name: '测试',

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,4 +1,4 @@
import { mount } from '../../../test/utils';
import { mount } from '../../../test';
import AddressList from '..';
const list = [

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,6 +1,6 @@
import Area from '..';
import areaList from '../demo/area.simple';
import { mount, later, triggerDrag } from '../../../test/utils';
import { mount, later, triggerDrag } from '../../../test';
const firstOption = [
{ code: '110000', name: '北京市' },

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,4 +1,4 @@
import { mount } from '../../../test/utils';
import { mount } from '../../../test';
import Button from '..';
test('loading size', () => {

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,5 +1,5 @@
import Card from '..';
import { mount } from '../../../test/utils';
import { mount } from '../../../test';
test('click event', () => {
const onClick = jest.fn();

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,6 +1,6 @@
import Cell from '..';
import CellGroup from '../../cell-group';
import { mount } from '../../../test/utils';
import { mount } from '../../../test';
test('click event', () => {
const click = jest.fn();

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,7 +1,7 @@
import Vue from 'vue';
import Checkbox from '..';
import CheckboxGroup from '../../checkbox-group';
import { mount, later } from '../../../test/utils';
import { mount, later } from '../../../test';
Vue.use(Checkbox);
Vue.use(CheckboxGroup);

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,6 +1,6 @@
import Vue from 'vue';
import Circle from '..';
import { mount, later } from '../../../test/utils';
import { mount, later } from '../../../test';
test('speed is 0', async () => {
const wrapper = mount(Circle, {

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,6 +1,6 @@
import Col from '..';
import Row from '../../row';
import { mount } from '../../../test/utils';
import { mount } from '../../../test';
test('Col click event', () => {
const wrapper = mount(Col);

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,7 +1,7 @@
import Vue from 'vue';
import Collapse from '..';
import CollapseItem from '../../collapse-item';
import { later, mount } from '../../../test/utils';
import { later, mount } from '../../../test';
Vue.use(Collapse);
Vue.use(CollapseItem);

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,7 +1,7 @@
import ContactCard from '..';
import ContactList from '../../contact-list';
import ContactEdit from '../../contact-edit';
import { mount, later } from '../../../test/utils';
import { mount, later } from '../../../test';
const contactInfo = {
name: 'test',

View File

@ -1,6 +1,6 @@
import Vue from 'vue';
import CountDown from '..';
import { mount, later } from '../../../test/utils';
import { mount, later } from '../../../test';
Vue.use(CountDown);

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,7 +1,7 @@
import Coupon from '../../coupon';
import CouponList from '..';
import CouponCell from '../../coupon-cell';
import { later, mount } from '../../../test/utils';
import { later, mount } from '../../../test';
const coupon = {
id: 1,

View File

@ -1,5 +1,5 @@
import DatePicker from '../DatePicker';
import { mount, later, triggerDrag } from '../../../test/utils';
import { mount, later, triggerDrag } from '../../../test';
function filter(type, options) {
const mod = type === 'year' ? 10 : 5;

View File

@ -1,5 +1,5 @@
import DatetimePicker from '..';
import { mount } from '../../../test/utils';
import { mount } from '../../../test';
test('confirm & cancel event', () => {
const onConfirm = jest.fn();

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,5 +1,5 @@
import TimePicker from '../TimePicker';
import { mount, later, triggerDrag } from '../../../test/utils';
import { mount, later, triggerDrag } from '../../../test';
function filter(type, options) {
const mod = type === 'minute' ? 10 : 5;

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,7 +1,7 @@
import Vue from 'vue';
import Dialog from '..';
import DialogComponent from '../Dialog';
import { mount, later, trigger } from '../../../test/utils';
import { mount, later, trigger } from '../../../test';
test('Dialog function call', async () => {
Dialog.close();

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,4 +1,4 @@
import { mount, later } from '../../../test/utils';
import { mount, later } from '../../../test';
import Vue from 'vue';
import DropdownMenu from '..';
import DropdownItem from '../../dropdown-item';

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,5 +1,5 @@
import Field from '..';
import { mount, later } from '../../../test/utils';
import { mount, later } from '../../../test';
test('input event', () => {
const wrapper = mount(Field);

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,6 +1,6 @@
import Button from '../../goods-action-button';
import Icon from '../../goods-action-icon';
import { mount } from '../../../test/utils';
import { mount } from '../../../test';
test('Button click event', () => {
const wrapper = mount(Button);

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,7 +1,7 @@
import Vue from 'vue';
import Grid from '..';
import GridItem from '../../grid-item';
import { mount } from '../../../test/utils';
import { mount } from '../../../test';
Vue.use(Grid);
Vue.use(GridItem);

View File

@ -1,5 +1,5 @@
import Icon from '..';
import { mount } from '../../../test/utils';
import { mount } from '../../../test';
test('render icon with builtin icon name', () => {
const wrapper = mount(Icon, {

View File

@ -1,7 +1,7 @@
import Vue from 'vue';
import ImagePreview from '..';
import ImagePreviewVue from '../ImagePreview';
import { mount, trigger, triggerDrag, later } from '../../../test/utils';
import { mount, trigger, triggerDrag, later } from '../../../test';
function triggerZoom(el, x, y) {
trigger(el, 'touchstart', 0, 0, { x, y });

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,5 +1,5 @@
import { mount } from '../../../test/utils';
import { mount } from '../../../test';
import Image from '..';
test('click event', () => {

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,7 +1,7 @@
import Vue from 'vue';
import IndexBar from '..';
import IndexAnchor from '../../index-anchor';
import { mount, trigger, triggerDrag } from '../../../test/utils';
import { mount, trigger, triggerDrag } from '../../../test';
Vue.use(IndexBar);
Vue.use(IndexAnchor);

View File

@ -1,5 +1,5 @@
import Info from '..';
import { mount } from '../../../test/utils';
import { mount } from '../../../test';
test('should not render when info is empty string', () => {
const wrapper = mount(Info, {

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,5 +1,5 @@
import List from '..';
import { mount, later, mockGetBoundingClientRect } from '../../../test/utils';
import { mount, later, mockGetBoundingClientRect } from '../../../test';
test('load event', async () => {
const wrapper = mount(List);

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,4 +1,4 @@
import { mount } from '../../../test/utils';
import { mount } from '../../../test';
import Loading from '..';
test('size prop', () => {

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,5 +1,5 @@
import NavBar from '..';
import { mount } from '../../../test/utils';
import { mount } from '../../../test';
test('render left & right slot', () => {
const wrapper = mount(NavBar, {

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,5 +1,5 @@
import NoticeBar from '..';
import { mount } from '../../../test/utils';
import { mount } from '../../../test';
test('click event', () => {
const wrapper = mount(NoticeBar);

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,5 +1,5 @@
import Notify from '..';
import { later } from '../../../test/utils';
import { later } from '../../../test';
test('create a notify', async () => {
// should not cause error when call clear before show notify

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,5 +1,5 @@
import NumberKeyboard from '..';
import { mount, trigger } from '../../../test/utils';
import { mount, trigger } from '../../../test';
function clickKey(key) {
trigger(key, 'touchstart');

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,4 +1,4 @@
import { mount } from '../../../test/utils';
import { mount } from '../../../test';
import Overlay from '..';
test('z-index prop', () => {

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,5 +1,5 @@
import PasswordInput from '..';
import { mount } from '../../../test/utils';
import { mount } from '../../../test';
test('focus event', () => {
const focus = jest.fn();

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,6 +1,6 @@
import Picker from '..';
import PickerColumn from '../PickerColumn';
import { mount, triggerDrag, later } from '../../../test/utils';
import { mount, triggerDrag, later } from '../../../test';
const simpleColumn = ['1990', '1991', '1992', '1993', '1994', '1995'];
const columns = [

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,5 +1,5 @@
import Popup from '..';
import { mount, triggerDrag, later } from '../../../test/utils';
import { mount, triggerDrag, later } from '../../../test';
let wrapper;
afterEach(() => {

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,5 +1,5 @@
import Progress from '..';
import { mount, later } from '../../../test/utils';
import { mount, later } from '../../../test';
test('calc width', async () => {
const wrapper = mount(Progress, {

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,5 +1,5 @@
import PullRefresh from '..';
import { mount, later, trigger, triggerDrag } from '../../../test/utils';
import { mount, later, trigger, triggerDrag } from '../../../test';
test('change head content when pulling down', async () => {
const wrapper = mount(PullRefresh, {

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,7 +1,7 @@
import Vue from 'vue';
import Radio from '..';
import RadioGroup from '../../radio-group';
import { mount } from '../../../test/utils';
import { mount } from '../../../test';
Vue.use(Radio);
Vue.use(RadioGroup);

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,5 +1,5 @@
import Rate from '..';
import { mount, triggerDrag } from '../../../test/utils';
import { mount, triggerDrag } from '../../../test';
function mockGetBoundingClientRect(items) {
items.filter((icon, index) => {

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,5 +1,5 @@
import Search from '..';
import { mount } from '../../../test/utils';
import { mount } from '../../../test';
test('input event', () => {
const onInput = jest.fn();

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,4 +1,4 @@
import { mount } from '../../../test/utils';
import { mount } from '../../../test';
import Vue from 'vue';
import Sidebar from '..';
import SidebarItem from '../../sidebar-item';

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,4 +1,4 @@
import { mount } from '../../../test/utils';
import { mount } from '../../../test';
import Skeleton from '..';
test('row-width array', () => {

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -4,7 +4,7 @@ import {
trigger,
triggerDrag,
mockGetBoundingClientRect
} from '../../../test/utils';
} from '../../../test';
function mockRect(vertical) {
return mockGetBoundingClientRect({

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,5 +1,5 @@
import Stepper from '..';
import { mount, later } from '../../../test/utils';
import { mount, later } from '../../../test';
test('disabled stepper', () => {
const wrapper = mount(Stepper, {

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,4 +1,4 @@
import { mount } from '../../../test/utils';
import { mount } from '../../../test';
import Steps from '..';
import Step from '../../step';

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,4 +1,4 @@
import { mount, mockScrollTop } from '../../../test/utils';
import { mount, mockScrollTop } from '../../../test';
import Vue from 'vue';
import Sticky from '..';

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -1,5 +1,5 @@
import SubmitBar from '..';
import { mount } from '../../../test/utils';
import { mount } from '../../../test';
test('submit event', () => {
const submit = jest.fn();

View File

@ -1,4 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { snapshotDemo } from '../../../test/demo';
demoTest(Demo);
snapshotDemo(Demo);

View File

@ -4,7 +4,7 @@ import {
triggerDrag,
later,
mockGetBoundingClientRect
} from '../../../test/utils';
} from '../../../test';
const THRESHOLD = 0.15;
const defaultProps = {

View File

@ -1,17 +1,17 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { mockGetBoundingClientRect } from '../../../test/utils';
import { snapshotDemo } from '../../../test/demo';
import { mockGetBoundingClientRect } from '../../../test';
let restore;
demoTest(Demo, {
hookBeforeTest: () => {
snapshotDemo(Demo, {
beforeTest: () => {
restore = mockGetBoundingClientRect({
width: 100,
height: 100
});
},
hookAfterTest: () => {
afterTest: () => {
restore();
}
});

Some files were not shown because too many files have changed in this diff Show More