测试:抽象网络请求返回值成功检查;添加寻宝匹配初步测试
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user