From bd7517cfd489a9789f81c247fb45329881274d15 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Sat, 10 Mar 2018 06:07:55 +0100 Subject: Add support for async calls under coverage --- packages/contracts/test/token_registry.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'packages/contracts') diff --git a/packages/contracts/test/token_registry.ts b/packages/contracts/test/token_registry.ts index 5313ec1b1..9dcc77b82 100644 --- a/packages/contracts/test/token_registry.ts +++ b/packages/contracts/test/token_registry.ts @@ -142,8 +142,10 @@ describe('TokenRegistry', () => { await tokenReg.setTokenName.sendTransactionAsync(token1.address, token2.name, { from: owner, }); - const newData = await tokenRegWrapper.getTokenByNameAsync(token2.name); - const oldData = await tokenRegWrapper.getTokenByNameAsync(token1.name); + const [newData, oldData] = await Promise.all([ + tokenRegWrapper.getTokenByNameAsync(token2.name), + tokenRegWrapper.getTokenByNameAsync(token1.name), + ]); const expectedNewData = _.assign({}, token1, { name: token2.name }); const expectedOldData = nullToken; @@ -177,8 +179,10 @@ describe('TokenRegistry', () => { it('should change the token symbol when called by owner', async () => { await tokenReg.setTokenSymbol.sendTransactionAsync(token1.address, token2.symbol, { from: owner }); - const newData = await tokenRegWrapper.getTokenBySymbolAsync(token2.symbol); - const oldData = await tokenRegWrapper.getTokenBySymbolAsync(token1.symbol); + const [newData, oldData] = await Promise.all([ + tokenRegWrapper.getTokenBySymbolAsync(token2.symbol), + tokenRegWrapper.getTokenBySymbolAsync(token1.symbol), + ]); const expectedNewData = _.assign({}, token1, { symbol: token2.symbol }); const expectedOldData = nullToken; -- cgit