diff --git a/packages/web3-providers/src/resolvers/ProviderResolver.js b/packages/web3-providers/src/resolvers/ProviderResolver.js index f80a731baff..7a2241bde61 100644 --- a/packages/web3-providers/src/resolvers/ProviderResolver.js +++ b/packages/web3-providers/src/resolvers/ProviderResolver.js @@ -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; diff --git a/packages/web3-providers/tests/src/resolvers/ProviderResolverTest.js b/packages/web3-providers/tests/src/resolvers/ProviderResolverTest.js index 406cf45e890..aba811e1b02 100644 --- a/packages/web3-providers/tests/src/resolvers/ProviderResolverTest.js +++ b/packages/web3-providers/tests/src/resolvers/ProviderResolverTest.js @@ -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); }); });