From 6462cfee963da4d75e737bc61698fc1287e17d6f Mon Sep 17 00:00:00 2001 From: liangtongchuan Date: Sun, 7 Mar 2021 15:34:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=EF=BC=9A=E5=BB=B6=E6=97=B6?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E7=BE=A4=E6=B6=88=E6=81=AF=EF=BC=8C=E6=8E=92?= =?UTF-8?q?=E6=9F=A5=E6=B5=8B=E8=AF=95=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/test/chat.test.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/game-server/test/chat.test.ts b/game-server/test/chat.test.ts index 6c3696894..9ff5132a4 100644 --- a/game-server/test/chat.test.ts +++ b/game-server/test/chat.test.ts @@ -30,23 +30,25 @@ function testGroupMsg(pinusClient: PinusWSClient, roleInfo: any, pinusClientT: P const roomId = `${channel}_${channelId}`; pinusClientT.on(ON_GROUP_MSG_ROUTE, (res) => { checkSuccessResponse(res); - console.log('got res:', roomId, res); + console.log('got res 1:', roomId, res); checkGroupMsg(res.data, roleInfo.roleId, roomId, TEXT_MSG.content); msgReceiveCnt += 1; }); pinusClient.on(ON_GROUP_MSG_ROUTE, (res) => { checkSuccessResponse(res); - console.log('got res:', roomId, res); + console.log('got res 2:', roomId, res); checkGroupMsg(res.data, roleInfo.roleId, roomId, TEXT_MSG.content); msgReceiveCnt += 1; }); - pinusClient.request('chat.chatHandler.sendGroupMessage', sendGroupMessageParm(channel, channelId, TEXT_MSG), (res) => { - checkSuccessResponse(res, false); - setTimeout(() => { - expect(msgReceiveCnt).to.be.equal(2); - done(); - }, 2000); - }); + setTimeout(() => { + pinusClient.request('chat.chatHandler.sendGroupMessage', sendGroupMessageParm(channel, channelId, TEXT_MSG), (res) => { + checkSuccessResponse(res, false); + setTimeout(() => { + expect(msgReceiveCnt).to.be.equal(2); + done(); + }, 1000); + }); + }, 100); } describe('聊天测试', function() {