提交 81569837 编写于 作者: F fxy060608

chore: 调整KeepAlive测试例

上级 a73566be
......@@ -58,7 +58,9 @@ if (process.env.UNI_PROJECT_TYPE === '1.0' && (process.env.uniTestPlatformInfo.t
describe('testCallbackKeepAlive', () => {
it("jest_testCallbackKeepAlive", async () => {
const res = await page.callMethod('jest_testCallbackKeepAlive')
expect(res).toEqual(true)
page.waitFor(10)
const count = await page.data('count')
expect(count).toEqual(18)
})
})
}
\ No newline at end of file
......@@ -25,7 +25,8 @@
data() {
return {
title: 'UTS基础语法',
result: {}
result: {},
count: 0
}
},
onReady() {
......@@ -49,7 +50,7 @@
if (count < 2) {
ret = false
}
count = 0;
// count = 0;
testKeepAlive((res) => {
count++;
......@@ -59,7 +60,7 @@
if (count < 2) {
ret = false
}
count = 0;
// count = 0;
testKeepAliveOption({
a: "testKeepAliveOption",
......@@ -72,7 +73,7 @@
if (count < 2) {
ret = false
}
count = 0;
// count = 0;
TestKeepAliveClass.onTestStatic((res) => {
count++;
......@@ -82,7 +83,7 @@
if (count < 2) {
ret = false
}
count = 0;
// count = 0;
TestKeepAliveClass.testKeepAliveStatic((res) => {
count++;
......@@ -92,7 +93,7 @@
if (count < 2) {
ret = false
}
count = 0;
// count = 0;
TestKeepAliveClass.testKeepAliveOptionStatic({
a: "testKeepAliveOption",
......@@ -105,7 +106,7 @@
if (count < 2) {
ret = false
}
count = 0;
// count = 0;
const obj = new TestKeepAliveClass()
obj.onTest((res) => {
......@@ -116,7 +117,7 @@
if (count < 2) {
ret = false
}
count = 0;
// count = 0;
obj.testKeepAlive((res) => {
count++;
......@@ -126,7 +127,7 @@
if (count < 2) {
ret = false
}
count = 0;
// count = 0;
obj.testKeepAliveOption({
a: "testKeepAliveOption",
......@@ -138,6 +139,9 @@
if (count < 2) {
ret = false
}
setTimeout(()=>{
this.count = count
},10)
return ret
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册