aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-12-07 12:30:08 +0800
committerFabio Berger <me@fabioberger.com>2017-12-07 12:30:08 +0800
commit0c23f5e07e7f5f4c432fde6a2c441a50b1b03ad6 (patch)
tree5aea9876287537797f9020d9d9a08d7f7f0f8091
parent86e1fa815366aa7410386fddc7d6aa81c15f1fa7 (diff)
downloaddexon-sol-tools-0c23f5e07e7f5f4c432fde6a2c441a50b1b03ad6.tar.gz
dexon-sol-tools-0c23f5e07e7f5f4c432fde6a2c441a50b1b03ad6.tar.zst
dexon-sol-tools-0c23f5e07e7f5f4c432fde6a2c441a50b1b03ad6.zip
Use rejectedWith
-rw-r--r--packages/subproviders/test/unit/ledger_subprovider_test.ts13
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);
});
});
});