diff --git a/pages/API/unicloud/unicloud/cloud-function.test.js b/pages/API/unicloud/unicloud/cloud-function.test.js index 8f164ae35c4d3a9e3f0bbad688d42a9945c446cc..16b97a9e42f099a6d517bf19900becfc863ac599 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 5d4ac3d84eb440c663ae18fbc2601e3c7404d18c..d3c1c5bb485a97c3613eaa1b72bb3c7906103b97 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 } } }