提交 7318dae0 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

test: getApp

上级 d0217af5
...@@ -8,5 +8,6 @@ describe('getApp', () => { ...@@ -8,5 +8,6 @@ describe('getApp', () => {
await page.callMethod('_increasetLifeCycleNum') await page.callMethod('_increasetLifeCycleNum')
const newData = await page.data() const newData = await page.data()
expect(newData.lifeCycleNum - oldData.lifeCycleNum).toBe(100) expect(newData.lifeCycleNum - oldData.lifeCycleNum).toBe(100)
await page.callMethod('setLifeCycleNum', oldData.lifeCycleNum)
}) })
}) })
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</view> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
import { state } from '@/store/index.uts' import { state, setLifeCycleNum } from '@/store/index.uts'
export default { export default {
data() { data() {
return { return {
...@@ -24,6 +24,10 @@ export default { ...@@ -24,6 +24,10 @@ export default {
app.increasetLifeCycleNum() app.increasetLifeCycleNum()
this.lifeCycleNum = state.lifeCycleNum this.lifeCycleNum = state.lifeCycleNum
}, },
// 自动化测试
setLifeCycleNum(num: number) {
setLifeCycleNum(num)
},
}, },
} }
</script> </script>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册