Skip to content

Commit

Permalink
chore: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e committed Nov 21, 2023
1 parent 669f75f commit a698468
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions test/unit/addressResolvers/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,15 @@ describe('addressResolvers', () => {
});

it('should return the address associated to the handle', () => {
return expect(resolveName('snapshot.crypto')).resolves.toEqual(
'0xeF8305E140ac520225DAf050e2f71d5fBcC543e7'
);
return expect(resolveName('snapshot.crypto')).resolves.toEqual({
'snapshot.crypto': '0xeF8305E140ac520225DAf050e2f71d5fBcC543e7'
});
}, 10e3);

it('return null when the handle does not exist', () => {
return expect(resolveName('test-snapshot.eth')).resolves.toBeUndefined();
return expect(resolveName('test-snapshot.eth')).resolves.toEqual({
'test-snapshot.eth': undefined
});
}, 10e3);
});

Expand All @@ -115,9 +117,9 @@ describe('addressResolvers', () => {
});

it('should cache the results', async () => {
await expect(resolveName('snapshot.crypto')).resolves.toEqual(
'0xeF8305E140ac520225DAf050e2f71d5fBcC543e7'
);
await expect(resolveName('snapshot.crypto')).resolves.toEqual({
'snapshot.crypto': '0xeF8305E140ac520225DAf050e2f71d5fBcC543e7'
});

return expect(getCache(['snapshot.crypto'])).resolves.toEqual({
'snapshot.crypto': '0xeF8305E140ac520225DAf050e2f71d5fBcC543e7'
Expand All @@ -127,7 +129,9 @@ describe('addressResolvers', () => {
it('should return the cached results', async () => {
await setCache({ 'snapshot.crypto': '0x0' });

return expect(resolveName('snapshot.crypto')).resolves.toEqual('0x0');
return expect(resolveName('snapshot.crypto')).resolves.toEqual({
'snapshot.crypto': '0x0'
});
});
});
});
Expand Down

0 comments on commit a698468

Please sign in to comment.