提交 b08014d5 编写于 作者: M mehaotian

fix: 统计测试例

上级 c2d00bdb
......@@ -48,15 +48,15 @@
// } as PerformanceObserverOptions)
// 统计上报 - 应用启动
// #ifdef APP-ANDROID || APP-IOS || WEB
// uni.report({
// name: 'uni-app-launch',
// options: res,
// success(res_data) {
// console.log(res_data);
// }, fail(err) {
// console.log(err);
// }
// })
uni.report({
name: 'uni-app-launch',
options: res,
success(res_data) {
console.log(res_data);
}, fail(err) {
console.log(err);
}
})
// #endif
// #ifdef APP
if (process.env.NODE_ENV !== 'development') { //真机运行可以注释此条件
......@@ -89,14 +89,14 @@
// #ifdef APP-ANDROID || APP-IOS || WEB
// 统计上报 - 应用显示
// uni.report({
// name: 'uni-app-show',
// success(res_data) {
// console.log(res_data);
// }, fail(err) {
// console.log(err);
// }
// })
uni.report({
name: 'uni-app-show',
success(res_data) {
console.log(res_data);
}, fail(err) {
console.log(err);
}
})
// #endif
},
onHide: function () {
......@@ -106,14 +106,14 @@
// #ifdef APP-ANDROID || APP-IOS || WEB
// 统计上报 - 应用进入后台
// uni.report({
// name: 'uni-app-hide',
// success(res) {
// console.log(res);
// }, fail(err) {
// console.log(err);
// }
// })
uni.report({
name: 'uni-app-hide',
success(res) {
console.log(res);
}, fail(err) {
console.log(err);
}
})
// #endif
},
// #ifdef APP-ANDROID
......@@ -143,15 +143,15 @@
// console.log('App onError', err)
// #ifdef APP-ANDROID || APP-IOS || WEB
// 统计上报 - 应用发生错误
// uni.report({
// name: 'uni-app-error',
// options: err,
// success(res) {
// console.log(res);
// }, fail(err) {
// console.log(err);
// }
// })
uni.report({
name: 'uni-app-error',
options: err,
success(res) {
console.log(res);
}, fail(err) {
console.log(err);
}
})
// #endif
},
methods: {
......
// 自动化测试
module.exports = {
"is-custom-runtime": false,
"compile": true,
......@@ -29,11 +28,11 @@ module.exports = {
"executablePath": ""
},
"uni-app-x": {
"version": "/Applications/HBuilderX-Alpha.app/Contents/HBuilderX/plugins/uniappx-launcher/base/version.txt",
"version": "/Applications/HBuilderX-Dev.app/Contents/HBuilderX/plugins/uniappx-launcher/base/version.txt",
"android": {
"id": "emulator-5554",
"executablePath": "/Applications/HBuilderX-Alpha.app/Contents/HBuilderX/plugins/uniappx-launcher/base/android_base.apk"
"id": "4fa6954",
"executablePath": "/Applications/HBuilderX-Dev.app/Contents/HBuilderX/plugins/uniappx-launcher/base/android_base.apk"
}
}
}
}
}
\ No newline at end of file
......@@ -6,7 +6,7 @@ module.exports = {
watchPathIgnorePatterns: ['/node_modules/', '/dist/', '/.git/'],
moduleFileExtensions: ['js', 'json'],
rootDir: __dirname,
testMatch: ["<rootDir>/pages/**/*test.[jt]s?(x)"],
testMatch: ["<rootDir>/pages/API/report/report.test.js"],
testPathIgnorePatterns: [
'/node_modules/',
],
......
// 仅测试 console.log 时机问题
import './test-main-console.uts'
// // #ifdef APP-ANDROID || APP-IOS || WEB
// import { uniStat } from '@/uni_modules/uni-stat/plugin.uts'
// // #endif
// #ifdef APP-ANDROID || APP-IOS || WEB
import { uniStat } from '@/uni_modules/uni-stat/plugin.uts'
// #endif
import App from './App.uvue'
import { createSSRApp } from 'vue'
// // 统计配置
// const uniStatcollectItems = {
// uniStatPageLog: true
// }
// 统计配置
const uniStatcollectItems = {
uniStatPageLog: true
}
// const uniStatOptions = {
// debug: true,
// collectItems: uniStatcollectItems,
// }
const uniStatOptions = {
debug: false,
collectItems: uniStatcollectItems,
}
export function createApp() {
const app = createSSRApp(App)
// // #ifdef APP-ANDROID || APP-IOS || WEB
// app.use(uniStat, uniStatOptions)
// // #endif
// #ifdef APP-ANDROID || APP-IOS || WEB
app.use(uniStat, uniStatOptions)
// #endif
// app.mixin({
// onReady() {
// setTimeout(() => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册