diff options
author | Fabio Berger <me@fabioberger.com> | 2017-12-07 12:30:08 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-12-07 12:30:08 +0800 |
commit | 0c23f5e07e7f5f4c432fde6a2c441a50b1b03ad6 (patch) | |
tree | 5aea9876287537797f9020d9d9a08d7f7f0f8091 /packages/subproviders/test/unit | |
parent | 86e1fa815366aa7410386fddc7d6aa81c15f1fa7 (diff) | |
download | dexon-sol-tools-0c23f5e07e7f5f4c432fde6a2c441a50b1b03ad6.tar dexon-sol-tools-0c23f5e07e7f5f4c432fde6a2c441a50b1b03ad6.tar.gz dexon-sol-tools-0c23f5e07e7f5f4c432fde6a2c441a50b1b03ad6.tar.bz2 dexon-sol-tools-0c23f5e07e7f5f4c432fde6a2c441a50b1b03ad6.tar.lz dexon-sol-tools-0c23f5e07e7f5f4c432fde6a2c441a50b1b03ad6.tar.xz dexon-sol-tools-0c23f5e07e7f5f4c432fde6a2c441a50b1b03ad6.tar.zst dexon-sol-tools-0c23f5e07e7f5f4c432fde6a2c441a50b1b03ad6.zip |
Use rejectedWith
Diffstat (limited to 'packages/subproviders/test/unit')
-rw-r--r-- | packages/subproviders/test/unit/ledger_subprovider_test.ts | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/packages/subproviders/test/unit/ledger_subprovider_test.ts b/packages/subproviders/test/unit/ledger_subprovider_test.ts index 3d6a2c49c..bc9671948 100644 --- a/packages/subproviders/test/unit/ledger_subprovider_test.ts +++ b/packages/subproviders/test/unit/ledger_subprovider_test.ts @@ -80,15 +80,10 @@ describe('LedgerSubprovider', () => { describe('failure cases', () => { it('cannot open multiple simultaneous connections to the Ledger device', async () => { const data = ethUtils.bufferToHex(ethUtils.toBuffer('hello world')); - try { - const result = await Promise.all([ - ledgerSubprovider.getAccountsAsync(), - ledgerSubprovider.signPersonalMessageAsync(data), - ]); - throw new Error('Multiple simultaneous calls succeeded when they should have failed'); - } catch (err) { - expect(err.message).to.be.equal(LedgerSubproviderErrors.MultipleOpenConnectionsDisallowed); - } + return expect(Promise.all([ + ledgerSubprovider.getAccountsAsync(), + ledgerSubprovider.signPersonalMessageAsync(data), + ])).to.be.rejectedWith(LedgerSubproviderErrors.MultipleOpenConnectionsDisallowed); }); }); }); |