diff --git a/CHANGELOG.md b/CHANGELOG.md index 34a888f..52a8753 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.1.0 (2021-08-12) +# 0.1.0 (2021-08-13) ### 🌟 新功能 范围|描述|commitId @@ -122,6 +122,7 @@ ### 🔧 测试 范围|描述|commitId --|--|-- + - | 添加测试,测试utils/time.js的computeDurationText | e758010 - | 禁用任务开始操作 | b5425db diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..1fe3e29 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,52 @@ +module.exports = { + globalTeardown: '@dcloudio/uni-automator/dist/teardown.js', + // testEnvironment: '@dcloudio/uni-automator/dist/environment.js', + testEnvironmentOptions: { + compile: true, + h5: { + // 为了节省测试时间,可以指定一个 H5 的 url 地址,若不指定,每次运行测试,会先 npm run dev:h5 + url: 'http://localhost:8080/tall/v3.0.1/#/h5', + options: { + headless: true, // 配置是否显示 puppeteer 测试窗口 + args: ['--no-sandbox'], + }, + }, + 'app-plus': { + // 需要安装 HBuilderX + android: { + executablePath: 'HBuilderX/plugins/launcher/base/android_base.apk', // apk 目录 + }, + ios: { + // uuid 必须配置,目前仅支持模拟器,可以(xcrun simctl list)查看要使用的模拟器 uuid + id: '', + executablePath: 'HBuilderX/plugins/launcher/base/Pandora_simulator.app', // ipa 目录 + }, + }, + 'mp-weixin': { + port: 9420, // 默认 9420 + account: '', // 测试账号 + args: '', // 指定开发者工具参数 + cwd: '', // 指定开发者工具工作目录 + launch: true, // 是否主动拉起开发者工具 + teardown: 'disconnect', // 可选值 "disconnect"|"close" 运行测试结束后,断开开发者工具或关闭开发者工具 + remote: false, // 是否真机自动化测试 + executablePath: '', // 开发者工具cli路径,默认会自动查找, windows: C:/Program Files (x86)/Tencent/微信web开发者工具/cli.bat", mac: /Applications/wechatwebdevtools.app/Contents/MacOS/cli + }, + 'mp-baidu': { + port: 9430, // 默认 9430 + args: '', // 指定开发者工具参数 + cwd: '', // 指定开发者工具工作目录 + launch: true, // 是否主动拉起开发者工具 + teardown: 'disconnect', // 可选值 "disconnect"|"close" 运行测试结束后,断开开发者工具或关闭开发者工具 + remote: false, // 是否真机自动化测试 + executablePath: '', // 开发者工具cli路径,默认会自动查找 + }, + }, + testTimeout: 15000, + reporters: ['default'], + watchPathIgnorePatterns: ['/node_modules/', '/dist/', '/.git/'], + moduleFileExtensions: ['js', 'json'], + rootDir: __dirname, + testMatch: ['/src/test/**/*test.[jt]s?(x)'], // 测试文件目录 + testPathIgnorePatterns: ['/node_modules/'], +};