diff --git a/jest.config.js b/jest.config.js index 634376e2..5f885c0a 100644 --- a/jest.config.js +++ b/jest.config.js @@ -8,7 +8,7 @@ module.exports = { diagnostics: false, }, }, - testTimeout: 40000, + testTimeout: 50000, coveragePathIgnorePatterns: ['/node_modules/', '/src/tests/'], setupFilesAfterEnv: ['/src/tests/jestSetup.ts'], }; diff --git a/src/tests/Ens.test.ts b/src/tests/Ens.test.ts index 0c742856..0e0982d0 100644 --- a/src/tests/Ens.test.ts +++ b/src/tests/Ens.test.ts @@ -44,13 +44,26 @@ describe('ENS', () => { }); it('resolves .eth name using blockchain', async () => { + expect(ens.url).toBe( + getProtocolLinkFromEnv(ProviderProtocol.http, NamingServiceName.ENS), + ); expect(ens.network).toEqual(5); - expect(await resolution.addr('abjbash.eth', 'ETH')).toEqual( - '0x5842DdB424B7884E52eC417E10C629A9B8e6BADa', + + const eyes = mockAsyncMethods(ens, { + resolver: '0x5FfC014343cd971B7eb70732021E26C35B744cc4', + fetchAddress: '0xa59C818Ddb801f1253edEbf0Cf08c9E481EA2fE5', + }); + const spy = mockAsyncMethods(ens, { + owner: '0xa59C818Ddb801f1253edEbf0Cf08c9E481EA2fE5', + }); + expect(await resolution.addr('matthewgould.eth', 'ETH')).toEqual( + '0xa59C818Ddb801f1253edEbf0Cf08c9E481EA2fE5', ); - expect(await resolution.owner('abjbash.eth')).toEqual( - '0x114D4603199df73e7D157787f8778E21fCd13066', + expect(await resolution.owner('matthewgould.eth')).toEqual( + '0xa59C818Ddb801f1253edEbf0Cf08c9E481EA2fE5', ); + expectSpyToBeCalled(eyes); + expectSpyToBeCalled(spy, 1); }); skipItInLive('reverses address to ENS domain', async () => { diff --git a/src/tests/jestSetup.ts b/src/tests/jestSetup.ts index 3300f5fc..e92d7dcb 100644 --- a/src/tests/jestSetup.ts +++ b/src/tests/jestSetup.ts @@ -3,7 +3,7 @@ import nock from 'nock'; beforeAll(() => { if (!isLive()) { - // nock.disableNetConnect(); + nock.disableNetConnect(); } });