提交 75686c7f 编写于 作者: fxy060608's avatar fxy060608

Update basicTest.vue

上级 81569837
<template> <template>
<view class="content"> <view class="content">
<page-head :title="title"></page-head> <page-head :title="title"></page-head>
<view v-for="(item,name) in result" :key="name" class="result"> <view v-for="(item,name) in result" :key="name" class="result">
<view>{{name}}测试结果:</view> <view>{{name}}测试结果:</view>
<view> <view>
测试api:{{item.passed.join(', ')}} 测试api:{{item.passed.join(', ')}}
</view> </view>
<view>总共:{{item.total}}</view> <view>总共:{{item.total}}</view>
<view>通过:{{item.passed.length}}</view> <view>通过:{{item.passed.length}}</view>
<view>失败:{{item.failed.length}}</view> <view>失败:{{item.failed.length}}</view>
<view v-for="(fail,index) in item.failed" :key="index" class="failed"> <view v-for="(fail,index) in item.failed" :key="index" class="failed">
<view>{{fail.split('\n')[0]}}</view> <view>{{fail.split('\n')[0]}}</view>
<view>{{fail.split('\n')[1]}}</view> <view>{{fail.split('\n')[1]}}</view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import { import {
runTests runTests
} from '../../uni_modules/uts-tests' } from '../../uni_modules/uts-tests'
import { onTest1, testKeepAlive, testKeepAliveOption, TestKeepAliveClass } from '@/uni_modules/uts-tests' import { onTest1, testKeepAlive, testKeepAliveOption, TestKeepAliveClass } from '@/uni_modules/uts-tests'
export default { export default {
data() { data() {
return { return {
title: 'UTS基础语法', title: 'UTS基础语法',
result: {}, result: {},
count: 0 count: 0
} }
}, },
onReady() { onReady() {
this.test() this.test()
}, },
methods: { methods: {
test() { test() {
this.result = runTests() this.result = runTests()
console.log(this.result) console.log(this.result)
}, },
jest_testCallbackKeepAlive() { jest_testCallbackKeepAlive() {
...@@ -141,28 +141,28 @@ ...@@ -141,28 +141,28 @@
} }
setTimeout(()=>{ setTimeout(()=>{
this.count = count this.count = count
},10) },50)
return ret return ret
} }
} }
} }
</script> </script>
<style> <style>
@import '@/common/uni-uvue.css'; @import '@/common/uni-uvue.css';
.content { .content {
min-height: 100%; min-height: 100%;
padding: 32rpx; padding: 32rpx;
} }
.passed { .passed {
color: green; color: green;
} }
.failed { .failed {
color: red; color: red;
} }
.result { .result {
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册