From 5fc141e9491a6f021f0a00f9e5588791f4ea7ba7 Mon Sep 17 00:00:00 2001 From: taohebin Date: Fri, 22 Nov 2024 16:18:52 +0800 Subject: [PATCH] =?UTF-8?q?update=EF=BC=9A=20pages/API/request/request.uvu?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/API/request/request.test.js | 9 +++++++++ pages/API/request/request.uvue | 18 +++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/pages/API/request/request.test.js b/pages/API/request/request.test.js index 2e3f62db..276cea3e 100644 --- a/pages/API/request/request.test.js +++ b/pages/API/request/request.test.js @@ -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) + }) + } }); diff --git a/pages/API/request/request.uvue b/pages/API/request/request.uvue index e5391549..7ef3e6a8 100644 --- a/pages/API/request/request.uvue +++ b/pages/API/request/request.uvue @@ -9,7 +9,7 @@ 请求方式 : {{method}} - + @@ -419,6 +419,22 @@ this.jest_result = false; }, }); + }, + jest_respone_with_404_and_string_generics(){ + uni.request({ + url: this.host + "/api/http/statusCode/404", + method: "GET", + timeout: null, + sslVerify: false, + withCredentials: false, + firstIpv4: false, + success: (res : RequestSuccess) => { + this.jest_result = true; + }, + fail: () => { + this.jest_result = false; + }, + }); } } } -- GitLab