From 785555729adec3b66bd57bbb69057def6931dbac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=BA=9A=E7=90=AA?= Date: Tue, 10 Sep 2024 17:36:49 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E5=A2=9E=E5=8A=A0instanceof=20UniCloud?= =?UTF-8?q?Error=E6=B5=8B=E8=AF=95=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/API/unicloud/unicloud/cloud-function.test.js | 5 +++++ pages/API/unicloud/unicloud/cloud-function.uvue | 3 +++ 2 files changed, 8 insertions(+) diff --git a/pages/API/unicloud/unicloud/cloud-function.test.js b/pages/API/unicloud/unicloud/cloud-function.test.js index 8f164ae3..16b97a9e 100644 --- a/pages/API/unicloud/unicloud/cloud-function.test.js +++ b/pages/API/unicloud/unicloud/cloud-function.test.js @@ -10,6 +10,11 @@ describe('unicloud-call-function', () => { }) }) + it('UniCloudError', async () => { + const result = await page.callMethod('jest_UniCloudError') + expect(result).toBe(false) + }) + it('callFunction', async () => { await page.callMethod('callFunction') const { diff --git a/pages/API/unicloud/unicloud/cloud-function.uvue b/pages/API/unicloud/unicloud/cloud-function.uvue index 5d4ac3d8..d3c1c5bb 100644 --- a/pages/API/unicloud/unicloud/cloud-function.uvue +++ b/pages/API/unicloud/unicloud/cloud-function.uvue @@ -99,6 +99,9 @@ uni.hideLoading() this.notify(error.errMsg, '错误') }) + }, + jest_UniCloudError() { + return new Error() instanceof UniCloudError } } } -- GitLab