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

test: 增加云对象errSubject测试

上级 925f0fda
......@@ -34,6 +34,7 @@ describe('unicloud-import-object', () => {
expect(genericDemoReturnTodoTitle).toBe(todoTitle)
expect(genericDemoReturnTodoContent).toBe(todoContent)
expect(failErrCode).toBe('TEST_ERROR_CODE')
expect(failErrSubject).toBe('fail')
expect(failErrDetailTips).toBe('DO_NOT_TRY_AGAIN')
expect(failNumberErrCode).toBe(-1)
expect(successErrCode).toBe(0)
......
......@@ -46,6 +46,7 @@
genericDemoReturnTodoTitle: '',
genericDemoReturnTodoContent: '',
failErrCode: '',
failErrSubject: '',
failErrDetailTips: '',
failNumberErrCode: 0,
successErrCode: -1,
......@@ -124,6 +125,7 @@
}).catch((err : any | null) => {
const error = err as UniCloudError
this.failErrCode = error.errCode as string
this.failErrSubject = error.errSubject as string
const detail = error.detail
if (detail != null && detail['tips'] != null) {
this.failErrDetailTips = detail['tips'] as string
......
......@@ -14,6 +14,7 @@ module.exports = {
console.log(random);
if (random > 0.5) {
return {
errSubject: 'randomFail',
errCode: 'RANDOM_FAIL',
errMsg: '[预期内的报错]执行失败请重试'
}
......@@ -27,6 +28,7 @@ module.exports = {
},
async fail() {
return {
errSubject: 'fail',
errCode: 'TEST_ERROR_CODE',
errMsg: '[预期内的报错]执行失败',
tips: 'DO_NOT_TRY_AGAIN'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册