Replace lodash with built-ins where possible to reduce bundle size (#1766)
* add tslint rule to disallow lodash.isUndefined * add tslint rule to disallow lodash.isNull * apply fixes
This commit is contained in:
@@ -114,7 +114,7 @@ describe('Web3Wrapper tests', () => {
|
||||
it('gets block when supplied a valid BlockParamLiteral value', async () => {
|
||||
const blockParamLiteral = BlockParamLiteral.Earliest;
|
||||
const blockIfExists = await web3Wrapper.getBlockIfExistsAsync(blockParamLiteral);
|
||||
if (_.isUndefined(blockIfExists)) {
|
||||
if (blockIfExists === undefined) {
|
||||
throw new Error('Expected block to exist');
|
||||
}
|
||||
expect(blockIfExists.number).to.be.equal(0);
|
||||
@@ -124,7 +124,7 @@ describe('Web3Wrapper tests', () => {
|
||||
it('gets block when supplied a block number', async () => {
|
||||
const blockParamLiteral = 0;
|
||||
const blockIfExists = await web3Wrapper.getBlockIfExistsAsync(blockParamLiteral);
|
||||
if (_.isUndefined(blockIfExists)) {
|
||||
if (blockIfExists === undefined) {
|
||||
throw new Error('Expected block to exist');
|
||||
}
|
||||
expect(blockIfExists.number).to.be.equal(0);
|
||||
@@ -132,11 +132,11 @@ describe('Web3Wrapper tests', () => {
|
||||
it('gets block when supplied a block hash', async () => {
|
||||
const blockParamLiteral = 0;
|
||||
const blockIfExists = await web3Wrapper.getBlockIfExistsAsync(blockParamLiteral);
|
||||
if (_.isUndefined(blockIfExists)) {
|
||||
if (blockIfExists === undefined) {
|
||||
throw new Error('Expected block to exist');
|
||||
}
|
||||
const sameBlockIfExists = await web3Wrapper.getBlockIfExistsAsync(blockIfExists.hash as string);
|
||||
if (_.isUndefined(sameBlockIfExists)) {
|
||||
if (sameBlockIfExists === undefined) {
|
||||
throw new Error('Expected block to exist');
|
||||
}
|
||||
expect(sameBlockIfExists.number).to.be.equal(0);
|
||||
|
||||
Reference in New Issue
Block a user