diff options
author | Fabio Berger <me@fabioberger.com> | 2018-05-16 20:59:10 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-05-16 20:59:10 +0800 |
commit | 839db68571037f6fff8273aaade6ea0bd14ea8a5 (patch) | |
tree | 302b3164f01bc5363bf07841a42fa30b3842169e /packages/json-schemas | |
parent | fec6ac3ff0c4781cea0b3f42e287aee2b8aa2a79 (diff) | |
download | dexon-sol-tools-839db68571037f6fff8273aaade6ea0bd14ea8a5.tar dexon-sol-tools-839db68571037f6fff8273aaade6ea0bd14ea8a5.tar.gz dexon-sol-tools-839db68571037f6fff8273aaade6ea0bd14ea8a5.tar.bz2 dexon-sol-tools-839db68571037f6fff8273aaade6ea0bd14ea8a5.tar.lz dexon-sol-tools-839db68571037f6fff8273aaade6ea0bd14ea8a5.tar.xz dexon-sol-tools-839db68571037f6fff8273aaade6ea0bd14ea8a5.tar.zst dexon-sol-tools-839db68571037f6fff8273aaade6ea0bd14ea8a5.zip |
Fix TSLint rules
Diffstat (limited to 'packages/json-schemas')
-rw-r--r-- | packages/json-schemas/test/schema_test.ts | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/json-schemas/test/schema_test.ts b/packages/json-schemas/test/schema_test.ts index 7b058781d..2e10fd71d 100644 --- a/packages/json-schemas/test/schema_test.ts +++ b/packages/json-schemas/test/schema_test.ts @@ -148,7 +148,8 @@ describe('Schema', () => { }); describe('#blockParamSchema', () => { it('should validate valid block param', () => { - const testCases = [42, 'latest', 'pending', 'earliest']; + const blockNumber = 42; + const testCases = [blockNumber, 'latest', 'pending', 'earliest']; validateAgainstSchema(testCases, blockParamSchema); }); it('should fail for invalid block param', () => { @@ -181,6 +182,7 @@ describe('Schema', () => { validateAgainstSchema(testCases, tokenSchema); }); it('should fail for invalid token', () => { + const num = 4; const testCases = [ { ...token, @@ -191,7 +193,7 @@ describe('Schema', () => { decimals: undefined, }, [], - 4, + num, ]; const shouldFail = true; validateAgainstSchema(testCases, tokenSchema, shouldFail); @@ -870,10 +872,12 @@ describe('Schema', () => { }); describe('#jsNumberSchema', () => { it('should validate valid js number', () => { + // tslint:disable-next-line:custom-no-magic-numbers const testCases = [1, 42]; validateAgainstSchema(testCases, jsNumber); }); it('should fail for invalid js number', () => { + // tslint:disable-next-line:custom-no-magic-numbers const testCases = [NaN, -1, new BigNumber(1)]; const shouldFail = true; validateAgainstSchema(testCases, jsNumber, shouldFail); @@ -881,13 +885,14 @@ describe('Schema', () => { }); describe('#txDataSchema', () => { it('should validate valid txData', () => { + const bigNumGasAmt = new BigNumber(42); const testCases = [ { from: NULL_ADDRESS, }, { from: NULL_ADDRESS, - gas: new BigNumber(42), + gas: bigNumGasAmt, }, { from: NULL_ADDRESS, |