diff --git a/game-server/test/Client.ts b/game-server/test/Client.ts index 77185fb18..24162b86f 100644 --- a/game-server/test/Client.ts +++ b/game-server/test/Client.ts @@ -15,13 +15,13 @@ export class Client { port: port }, (data) => { // 连接成功执行函数 - console.log('gate连接成功'); + // console.log('gate连接成功'); this._client.request('connector.entryHandler.debugQueryToken', {tel, magicWord: 'zyz666server518'}, (res) => { checkSuccessResponse(res); expect(res.data.token).to.be.an('string'); this._client.request('connector.entryHandler.enter', {serverId: 1, ...res.data}, (enterRes) => { // 消息回调 - console.log('connector返回'); + // console.log('connector返回'); checkSuccessResponse(enterRes); expect(enterRes.data.role).to.be.an('object'); this._roleInfo = enterRes.data.role; diff --git a/game-server/test/PinusWSClient.js b/game-server/test/PinusWSClient.js index 3f3e13f79..bfd8a4f6a 100644 --- a/game-server/test/PinusWSClient.js +++ b/game-server/test/PinusWSClient.js @@ -60,7 +60,9 @@ class PinusWSClient { this.handlers[Package.TYPE_KICK] = this.onKick; } init(params, cb) { - console.log('init', params); + if (PinusWSClient.DEBUG) { + console.log('init', params); + } this.initCallback = cb; let host = params.host; let port = params.port; @@ -74,7 +76,9 @@ class PinusWSClient { this.initWebSocket(host, port, cb); } initWebSocket(host, port, cb) { - console.log('[Pinus] connect to:', host, port); + if (PinusWSClient.DEBUG) { + console.log('[Pinus] connect to:', host, port); + } let url = 'ws://' + host; if (port) { url += ':' + port; @@ -135,11 +139,15 @@ class PinusWSClient { this.send(byte); } onConnect() { - console.log('[Pinus] connect success'); + if (PinusWSClient.DEBUG) { + console.log('[Pinus] connect success'); + } this.send(this._package.encode(Package.TYPE_HANDSHAKE, Protocol.strencode(JSON.stringify(this.handshakeBuffer)))); } onClose(e) { - console.error('[Pinus] connect close'); + if (PinusWSClient.DEBUG) { + console.error('[Pinus] connect close'); + } // this.emit(Pinus.EVENT_CLOSE,e); } onIOError(e) { @@ -260,7 +268,9 @@ class PinusWSClient { this._disconnect(); } _disconnect() { - console.warn('[Pinus] client disconnect ...'); + if (PinusWSClient.DEBUG) { + console.warn('[Pinus] client disconnect ...'); + } if (this.socket) this.socket.close(); this.socket = null; diff --git a/game-server/test/app.test.ts b/game-server/test/app.test.ts index 8cfb58975..6df395ae2 100644 --- a/game-server/test/app.test.ts +++ b/game-server/test/app.test.ts @@ -2,7 +2,7 @@ import 'mocha'; import { PinusWSClient } from 'pinus-robot-plugin'; import { expect } from 'chai'; import { Client } from './Client'; -describe('test zyz login', function() { +describe('测试赵云传登录', function() { let pinusClient: PinusWSClient; afterEach(function(done) { diff --git a/game-server/test/chat.test.ts b/game-server/test/chat.test.ts index 290cad228..ef758f946 100644 --- a/game-server/test/chat.test.ts +++ b/game-server/test/chat.test.ts @@ -1,13 +1,9 @@ -import { PrivateMessageParam, PrivateMessageType } from './../app/db/PrivateMessage'; import { DEFAULT_MSG_PER_PAGE, MSG_TYPE, ON_MSG_ROUTE } from './../app/consts'; -import { indexOf } from 'underscore'; -import { COM_TEAM_STATUS, DEFAULT_HEROES } from './../../shared/consts/consts'; import { Client } from './Client'; -import { COM_BTL_QUALITY } from './../app/consts/constModules/itemConst'; import 'mocha'; import { PinusWSClient } from 'pinus-robot-plugin'; import { expect } from 'chai'; -import { checkDisplayItems, checkSuccessResponse } from './CheckPatten'; +import { checkSuccessResponse } from './CheckPatten'; const TEXT_MSG = {type: MSG_TYPE.TEXT, content: 'hello world'} @@ -46,7 +42,6 @@ describe('聊天测试', function() { it('两个玩家互相发送', function(done) { pinusClientT.on(ON_MSG_ROUTE, (msg) => { - console.log(ON_MSG_ROUTE , msg); checkSuccessResponse(msg); expect(msg.data.content).to.equal(TEXT_MSG.content); }); diff --git a/game-server/test/comBattle.test.ts b/game-server/test/comBattle.test.ts index 259f84719..7bd4b5f71 100644 --- a/game-server/test/comBattle.test.ts +++ b/game-server/test/comBattle.test.ts @@ -74,13 +74,13 @@ describe('寻宝创建队伍', function() { it('两个玩家匹配到结算', function(done) { pinusClient.on('onTeammateAct', (msg) => { - console.log('onTeammateAct: ', msg); + checkSuccessResponse(msg); }); pinusClient.on('onComBtlStart', (msg) => { - console.log('onComBtlStart: ', msg); + checkSuccessResponse(msg); }); pinusClient.on('onTeamJoin', (msg) => { - console.log('onTeamJoin: ', msg); + checkSuccessResponse(msg); }); pinusClient.request('battle.comBattleHandler.createTeam', createTeamParms, (res) => { checkSuccessResponse(res); @@ -90,7 +90,7 @@ describe('寻宝创建队伍', function() { expect(roleSt).to.have.all.keys('roleId', 'roleName', 'isCap', 'isFrd', 'headHid', 'sHid', 'topLineupCe', 'lv', 'isRobot', 'heroes', 'killed', 'totalDmg', 'frdRatio'); }); pinusClientT.request('battle.comBattleHandler.searchTeam', searchTeamParms, (searchRes) => { - console.log('searchRes:', searchRes); + // console.log('searchRes:', searchRes); checkSuccessResponse(searchRes, false); if (searchRes.data && searchRes.data.teamCode) { expect(searchRes.data).to.be.an('object'); @@ -115,7 +115,7 @@ describe('寻宝创建队伍', function() { it('先搜索再创建队伍的匹配情况', function(done) { pinusClientT.request('battle.comBattleHandler.searchTeam', searchTeamParms, (searchRes) => { - console.log('searchRes:', searchRes); + // console.log('searchRes:', searchRes); checkSuccessResponse(searchRes, false); if (!searchRes.data) { pinusClient.request('battle.comBattleHandler.createTeam', createTeamParms, (res) => { diff --git a/game-server/test/pubUtils.test.ts b/game-server/test/pubUtils.test.ts index 8f763f5a5..3a50eebe8 100644 --- a/game-server/test/pubUtils.test.ts +++ b/game-server/test/pubUtils.test.ts @@ -1,10 +1,10 @@ import 'mocha'; import { expect } from 'chai'; import { resResult } from '../app/pubUtils/util'; -describe('测试 ts', function() { - it('用例1', function() { +describe('测试工具方法', function() { + it('测试 resResult', function() { const result = resResult({code: 0, simStr: 'hello'}); - console.log('ltc result: ', result); + // console.log('ltc result: ', result); expect(result).to.be.an('object'); expect(result.code).equal(0); expect(result.msg).equal('hello');