Skip to content

Commit

Permalink
eslint errors fixed and ProviderResolverTest improved
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Furter committed Feb 8, 2019
1 parent d850612 commit 4efc7c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 0 additions & 3 deletions packages/web3-providers/src/resolvers/ProviderResolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@

import isFunction from 'lodash/isFunction';
import isObject from 'lodash/isObject';
import HttpProvider from '../providers/HttpProvider';
import WebsocketProvider from '../providers/WebsocketProvider';
import IpcProvider from '../providers/IpcProvider';

/* eslint-disable no-new-func */
let global;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,11 @@ describe('ProviderResolverTest', () => {
});

it('calls resolve with the MetamaskInpageProvider', () => {
const provider = {constructor: {name: 'MetamaskInpageProvider'}};
new MetamaskInpageProvider();
const metamaskInpageProviderMock = MetamaskInpageProvider.mock.instances[0];

providersModuleFactoryMock.createMetamaskInpageProvider.mockReturnValueOnce(true)
providersModuleFactoryMock.createMetamaskInpageProvider.mockReturnValueOnce(metamaskInpageProviderMock);

expect(providerResolver.resolve(provider)).toEqual(true);
expect(providerResolver.resolve(metamaskInpageProviderMock)).toEqual(metamaskInpageProviderMock);
});
});

0 comments on commit 4efc7c5

Please sign in to comment.