Files
msh-system/msh_single_uniapp/tests/setup.ts

29 lines
598 B
TypeScript
Raw Normal View History

import { config } from '@vue/test-utils'
// Global test configuration
config.global.stubs = {
'uni-view': 'div',
'uni-text': 'span',
'uni-image': 'img',
'uni-button': 'button',
'uni-input': 'input',
'uni-scroll-view': 'div',
}
// Mock uni API
global.uni = {
showToast: jest.fn(),
showModal: jest.fn(),
showLoading: jest.fn(),
hideLoading: jest.fn(),
request: jest.fn(),
uploadFile: jest.fn(),
chooseImage: jest.fn(),
previewImage: jest.fn(),
getStorageSync: jest.fn(),
setStorageSync: jest.fn(),
removeStorageSync: jest.fn(),
}
console.log('Test setup loaded')