提交 8f23a34a 编写于 作者: 雪洛's avatar 雪洛

test: request增加timeout: null测试例

上级 9d158628
...@@ -78,6 +78,12 @@ describe('ExtApi-Request', () => { ...@@ -78,6 +78,12 @@ describe('ExtApi-Request', () => {
it('Check HEAD', async () => { it('Check HEAD', async () => {
await request(page, 'HEAD'); await request(page, 'HEAD');
}); });
it('Request with timeout null', async () => {
res = await page.callMethod('jest_timeout_null')
await page.waitFor(2000);
res = await page.data('jest_result');
expect(res).toBe(true)
});
let shouldTestCookie = false let shouldTestCookie = false
if (process.env.uniTestPlatformInfo.startsWith('android')) { if (process.env.uniTestPlatformInfo.startsWith('android')) {
......
...@@ -285,6 +285,22 @@ ...@@ -285,6 +285,22 @@
}, },
}); });
}, },
jest_timeout_null() {
uni.request({
url: this.host + (methodMap['GET'] as string),
method: "GET",
timeout: null,
sslVerify: false,
withCredentials: false,
firstIpv4: false,
success: () => {
this.jest_result = true;
},
fail: (err) => {
this.jest_result = false;
},
});
},
} }
} }
</script> </script>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册