From 839db68571037f6fff8273aaade6ea0bd14ea8a5 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 16 May 2018 14:59:10 +0200 Subject: Fix TSLint rules --- .../test/integration/ledger_subprovider_test.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'packages/subproviders/test/integration') diff --git a/packages/subproviders/test/integration/ledger_subprovider_test.ts b/packages/subproviders/test/integration/ledger_subprovider_test.ts index f1c634a77..8bf571041 100644 --- a/packages/subproviders/test/integration/ledger_subprovider_test.ts +++ b/packages/subproviders/test/integration/ledger_subprovider_test.ts @@ -19,6 +19,8 @@ import { reportCallbackErrors } from '../utils/report_callback_errors'; chaiSetup.configure(); const expect = chai.expect; +const DEFAULT_NUM_ACCOUNTS = 10; +const EXPECTED_SIGNATURE_LENGTH = 132; async function ledgerEthereumNodeJsClientFactoryAsync(): Promise { const ledgerConnection = await TransportNodeHid.create(); @@ -40,7 +42,7 @@ describe('LedgerSubprovider', () => { it('returns default number of accounts', async () => { const accounts = await ledgerSubprovider.getAccountsAsync(); expect(accounts[0]).to.not.be.an('undefined'); - expect(accounts.length).to.be.equal(10); + expect(accounts.length).to.be.equal(DEFAULT_NUM_ACCOUNTS); }); it('returns the expected accounts from a ledger set up with the test mnemonic', async () => { const accounts = await ledgerSubprovider.getAccountsAsync(); @@ -104,7 +106,7 @@ describe('LedgerSubprovider', () => { }; const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.be.a('null'); - expect(response.result.length).to.be.equal(10); + expect(response.result.length).to.be.equal(DEFAULT_NUM_ACCOUNTS); done(); }); ledgerProvider.sendAsync(payload, callback); @@ -122,7 +124,7 @@ describe('LedgerSubprovider', () => { }; const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.be.a('null'); - expect(response.result.length).to.be.equal(132); + expect(response.result.length).to.be.equal(EXPECTED_SIGNATURE_LENGTH); expect(response.result.substr(0, 2)).to.be.equal('0x'); done(); }); @@ -142,7 +144,7 @@ describe('LedgerSubprovider', () => { }; const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.be.a('null'); - expect(response.result.length).to.be.equal(132); + expect(response.result.length).to.be.equal(EXPECTED_SIGNATURE_LENGTH); expect(response.result.substr(0, 2)).to.be.equal('0x'); done(); }); @@ -196,7 +198,8 @@ describe('LedgerSubprovider', () => { const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.be.a('null'); const result = response.result; - expect(result.length).to.be.equal(66); + const signedTxLength = 66; + expect(result.length).to.be.equal(signedTxLength); expect(result.substr(0, 2)).to.be.equal('0x'); done(); }); -- cgit v1.2.3