测试:检查玩家数据
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user