提交 284984a6 编写于 作者: taohebin@dcloud.io's avatar taohebin@dcloud.io

test: request增加测试例

上级 924224ff
......@@ -164,4 +164,11 @@ describe('ExtApi-Request', () => {
expect(res).toBe(true)
})
}
it('Check Respone Json String', async () => {
res = await page.callMethod('jest_respone_json_string')
await page.waitFor(2000);
res = await page.data('jest_result');
expect(res).toBe(true)
})
});
......@@ -396,6 +396,18 @@
}
} as CommonOptions)
// #endif
},
jest_respone_json_string(){
uni.request({
url:"https://request.dcloud.net.cn/api/http/contentType/text/json",
success:(res: RequestSuccess<any>)=>{
console.log("res :", res, typeof res.data);
this.jest_result = typeof res.data == "object"
},
fail:(e: RequestFail)=>{
this.jest_result = false
}
})
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册