测试:抽象网络请求返回值成功检查;添加寻宝匹配初步测试

This commit is contained in:
liangtongchuan
2021-02-10 16:51:26 +08:00
parent 5cfb317589
commit dc36468016
4 changed files with 59 additions and 37 deletions
+9
View File
@@ -0,0 +1,9 @@
import { expect } from 'chai';
export function checkSuccessResponse(response, withData = true) {
expect(response).to.be.an('object');
expect(response.code).equal(0);
if (withData) {
expect(response.data).to.be.an('object');
}
}