提交 5fc141e9 编写于 作者: taohebin@dcloud.io's avatar taohebin@dcloud.io

update: pages/API/request/request.uvue

上级 32b5c7a0
......@@ -180,4 +180,13 @@ describe('ExtApi-Request', () => {
expect(res).toBe(true)
})
}
if(process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('android')){
it('Check Respone string generics when status is 404', async () => {
res = await page.callMethod('jest_respone_with_404_and_string_generics')
await page.waitFor(2000);
res = await page.data('jest_result');
expect(res).toBe(true)
})
}
});
......@@ -9,7 +9,7 @@
<text>请求方式 : {{method}}</text>
</view>
<view class="uni-btn-v uni-common-mt">
<button type="primary" @click="sendRequest">发起请求</button>
<button type="primary" @click="jest_respone_with_404_and_string_generics">发起请求</button>
</view>
</view>
<scroll-view style="flex: 1;" show-scrollbar="true">
......@@ -419,6 +419,22 @@
this.jest_result = false;
},
});
},
jest_respone_with_404_and_string_generics(){
uni.request<string>({
url: this.host + "/api/http/statusCode/404",
method: "GET",
timeout: null,
sslVerify: false,
withCredentials: false,
firstIpv4: false,
success: (res : RequestSuccess<string>) => {
this.jest_result = true;
},
fail: () => {
this.jest_result = false;
},
});
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册