Files
gym-manage/gym-manage-uniapp/e2e/jest.config.js
T

32 lines
1.2 KiB
JavaScript

const path = require('path');
/** @type {import('jest').Config} */
module.exports = {
testEnvironment: 'node',
rootDir: path.resolve(__dirname, '..'),
// 按顺序执行:smoke → profile-journey → booking-journey
// booking 最后运行因为其最后一个测试会进入非 tabbar 页面
testMatch: [
'<rootDir>/e2e/smoke/**/*.spec.js',
'<rootDir>/e2e/journeys/profile-journey.spec.js',
'<rootDir>/e2e/journeys/booking-journey.spec.js'
],
testTimeout: 120000,
verbose: true,
// 顺序运行,避免多个套件同时操作同一实例
maxWorkers: 1,
globalSetup: '<rootDir>/e2e/globalSetup.js',
globalTeardown: '<rootDir>/e2e/globalTeardown.js',
setupFiles: ['<rootDir>/e2e/setup.js'],
globals: {
// 微信开发者工具 CLI 路径
CLI_PATH: process.env.WECHAT_DEVTOOLS_CLI || 'D:\\微信web开发者工具\\cli.bat',
// UniApp 编译输出路径
PROJECT_PATH: process.env.UNIAPP_OUTPUT || path.resolve(__dirname, '../unpackage/dist/dev/mp-weixin'),
// 微信开发者工具服务端口
DEVTOOLS_PORT: parseInt(process.env.WECHAT_DEVTOOLS_PORT || '63956', 10),
// 小程序 AppID(测试用)
APP_ID: process.env.MP_APP_ID || ''
}
};