diff options
author | Fabio Berger <me@fabioberger.com> | 2018-05-23 00:04:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-23 00:04:50 +0800 |
commit | cc840a6911850856c3254f7ac73cd70c527e1a5c (patch) | |
tree | c7435ac7ce09541a67f0106a85f391dc48921e10 /packages/subproviders/test/integration | |
parent | a26cc7c14d4e59102d5f84d534f75c42b8683cad (diff) | |
parent | c4a2f700172e8be367225d90a1c51cef8cf0d7dd (diff) | |
download | dexon-sol-tools-cc840a6911850856c3254f7ac73cd70c527e1a5c.tar dexon-sol-tools-cc840a6911850856c3254f7ac73cd70c527e1a5c.tar.gz dexon-sol-tools-cc840a6911850856c3254f7ac73cd70c527e1a5c.tar.bz2 dexon-sol-tools-cc840a6911850856c3254f7ac73cd70c527e1a5c.tar.lz dexon-sol-tools-cc840a6911850856c3254f7ac73cd70c527e1a5c.tar.xz dexon-sol-tools-cc840a6911850856c3254f7ac73cd70c527e1a5c.tar.zst dexon-sol-tools-cc840a6911850856c3254f7ac73cd70c527e1a5c.zip |
Merge pull request #594 from 0xProject/improvement/addCustomTslintRules
Add more tslint rules
Diffstat (limited to 'packages/subproviders/test/integration')
-rw-r--r-- | packages/subproviders/test/integration/ledger_subprovider_test.ts | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/packages/subproviders/test/integration/ledger_subprovider_test.ts b/packages/subproviders/test/integration/ledger_subprovider_test.ts index 70fd2cfce..d3e9d0fde 100644 --- a/packages/subproviders/test/integration/ledger_subprovider_test.ts +++ b/packages/subproviders/test/integration/ledger_subprovider_test.ts @@ -20,6 +20,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<LedgerEthereumClient> { const ledgerConnection = await TransportNodeHid.create(); @@ -41,7 +43,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(); @@ -105,7 +107,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); @@ -123,7 +125,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(); }); @@ -143,7 +145,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(); }); @@ -197,7 +199,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(); }); |