提交 0f3a5927 编写于 作者: 雪洛's avatar 雪洛

test: 增加云对象error的detail属性测试例

上级 b92ef6a3
......@@ -24,6 +24,7 @@ describe('unicloud-import-object', () => {
genericDemoReturnTodoTitle,
genericDemoReturnTodoContent,
failErrCode,
failErrDetailTips,
failNumberErrCode,
successErrCode,
} = await page.data()
......@@ -33,6 +34,7 @@ describe('unicloud-import-object', () => {
expect(genericDemoReturnTodoTitle).toBe(todoTitle)
expect(genericDemoReturnTodoContent).toBe(todoContent)
expect(failErrCode).toBe('TEST_ERROR_CODE')
expect(failErrDetailTips).toBe('DO_NOT_TRY_AGAIN')
expect(failNumberErrCode).toBe(-1)
expect(successErrCode).toBe(0)
......
......@@ -42,6 +42,7 @@
genericDemoReturnTodoTitle: '',
genericDemoReturnTodoContent: '',
failErrCode: '',
failErrDetailTips: '',
failNumberErrCode: 0,
successErrCode: -1,
isUniTest: false
......@@ -119,6 +120,10 @@
}).catch((err : any | null) => {
const error = err as UniCloudError
this.failErrCode = error.errCode as string
const detail = error.detail
if (detail != null && detail['tips'] != null) {
this.failErrDetailTips = detail['tips']
}
console.error(error)
})
},
......
......@@ -29,6 +29,7 @@ module.exports = {
return {
errCode: 'TEST_ERROR_CODE',
errMsg: '[预期内的报错]执行失败',
tips: 'DO_NOT_TRY_AGAIN'
}
},
async failWithNumberErrCode() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册