测试:检查玩家数据

This commit is contained in:
luying
2021-11-05 17:37:50 +08:00
parent e0086c7d16
commit 62c238b89e
4 changed files with 149 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
import { PinusWSClient } from 'pinus-robot-plugin';
import { expect } from 'chai';
import { checkSuccessResponse } from './CheckPatten';
import { checkSuccessResponse, checkRoleInfo } from './CheckPatten';
import { ON_ADD_CHANNEL_ROUTE, STATUS } from '../app/consts';
import { genCode } from '../app/pubUtils/util';
const request = require('request');
@@ -70,7 +70,9 @@ export class Client {
// 消息回调
checkSuccessResponse(enterRes);
expect(enterRes.data.role).to.be.an('object');
checkRoleInfo(enterRes.data.role)
this._roleInfo = enterRes.data.role;
this._client.request('role.roleHandler.initRole', { serverId: this.serverId, token, roleName: genCode(8) }, (initRoleRes) => {
if (initRoleRes.code !== 0 && initRoleRes.code !== STATUS.ROLE_HAS_INIT.code) {
console.error('initRole error', initRoleRes.code, typeof initRoleRes.code);
@@ -101,4 +103,4 @@ export class Client {
decrypted += decipher.final('utf8');
return decrypted;
}
}
}