From 58ce33b54936ee986e7b57c10c2248eb0965d530 Mon Sep 17 00:00:00 2001 From: luying Date: Tue, 14 Sep 2021 16:21:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=EF=BC=9A=E6=8B=8D=E5=8D=96?= =?UTF-8?q?=E8=A1=8C=E5=87=BA=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/test/auction.test.ts | 34 +++++++++++++++++--------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/game-server/test/auction.test.ts b/game-server/test/auction.test.ts index e2521279e..a5bbc0524 100644 --- a/game-server/test/auction.test.ts +++ b/game-server/test/auction.test.ts @@ -142,23 +142,25 @@ describe('拍卖行测试', function () { checkDividend(res.data.dividend); } expect(res.data.lot.curBuyer).to.be.equal(roleInfo.roleId); - done(); - }); - unsoldLots.shift(); - if (unsoldLots.length === 0) { - console.warn('没有测试一口价的情况'); - done(); - return; - } - gid = unsoldLots[0].gid; - pinusClient.request('battle.auctionHandler.offer', { code: unsoldLots[0].code, max: true }, (res) => { - checkSuccessResponse(res); - checkLot(res.data.lot); - checkDividend(res.data.dividend); - expect(res.data.lot.curBuyer).to.be.equal(roleInfo.roleId); - setTimeout(() => { + + unsoldLots.shift(); + if (unsoldLots.length === 0) { + console.warn('没有测试一口价的情况'); done(); - }, 100); + return; + } + gid = unsoldLots[0].gid; + pinusClient.request('battle.auctionHandler.offer', { code: unsoldLots[0].code, max: true }, (res) => { + checkSuccessResponse(res); + checkLot(res.data.lot); + if(res.data.dividend) { + checkDividend(res.data.dividend); + } + expect(res.data.lot.curBuyer).to.be.equal(roleInfo.roleId); + setTimeout(() => { + done(); + }, 1000); + }); }); }); });