|
@@ -1,10 +1,7 @@
|
|
|
import '@testing-library/jest-dom'
|
|
import '@testing-library/jest-dom'
|
|
|
|
|
|
|
|
// 扩展全局类型以支持 Taro 配置测试
|
|
// 扩展全局类型以支持 Taro 配置测试
|
|
|
-declare global {
|
|
|
|
|
- // eslint-disable-next-line no-var
|
|
|
|
|
- var defineAppConfig: (config: any) => any
|
|
|
|
|
-}
|
|
|
|
|
|
|
+declare var defineAppConfig: (config: any) => any
|
|
|
|
|
|
|
|
/* eslint-disable react/display-name */
|
|
/* eslint-disable react/display-name */
|
|
|
|
|
|
|
@@ -14,7 +11,7 @@ process.env.TARO_PLATFORM = 'web'
|
|
|
process.env.SUPPORT_TARO_POLYFILL = 'disabled'
|
|
process.env.SUPPORT_TARO_POLYFILL = 'disabled'
|
|
|
|
|
|
|
|
// 定义 defineAppConfig 全局函数用于测试 Taro 配置文件
|
|
// 定义 defineAppConfig 全局函数用于测试 Taro 配置文件
|
|
|
-global.defineAppConfig = (config: any) => config
|
|
|
|
|
|
|
+;(global as any).defineAppConfig = (config: any) => config
|
|
|
|
|
|
|
|
// Mock Taro 组件
|
|
// Mock Taro 组件
|
|
|
// eslint-disable-next-line react/display-name
|
|
// eslint-disable-next-line react/display-name
|
|
@@ -438,4 +435,6 @@ jest.mock('@/components/ui/dialog', () => {
|
|
|
DialogTitle: ({ children, className }: any) => React.createElement('div', { className }, children),
|
|
DialogTitle: ({ children, className }: any) => React.createElement('div', { className }, children),
|
|
|
DialogFooter: ({ children, className }: any) => React.createElement('div', { className }, children)
|
|
DialogFooter: ({ children, className }: any) => React.createElement('div', { className }, children)
|
|
|
}
|
|
}
|
|
|
-})
|
|
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+export {}
|