Skip to content

Commit

Permalink
[DT-902] fix: test setup and timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
DChan0319 committed Sep 6, 2023
1 parent 068b415 commit 2896007
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 12
node-version: ${{ matrix.node }}

- name: Install Dependencies
run: yarn install
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
diagnostics: false,
},
},
testTimeout: 40000,
testTimeout: 50000,
coveragePathIgnorePatterns: ['/node_modules/', '/src/tests/'],
setupFilesAfterEnv: ['<rootDir>/src/tests/jestSetup.ts'],
};
21 changes: 17 additions & 4 deletions src/tests/Ens.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
2 changes: 1 addition & 1 deletion src/tests/jestSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import nock from 'nock';

beforeAll(() => {
if (!isLive()) {
// nock.disableNetConnect();
nock.disableNetConnect();
}
});

Expand Down

0 comments on commit 2896007

Please sign in to comment.