diff options
Diffstat (limited to 'packages/subproviders/test')
-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); }); }); }); |