From a69846884190a7ce0315cecf9036254cb1dd2dd0 Mon Sep 17 00:00:00 2001 From: Wan Qi Chen <495709+wa0x6e@users.noreply.github.com> Date: Tue, 21 Nov 2023 16:55:22 +0800 Subject: [PATCH] chore: fix test --- test/unit/addressResolvers/index.test.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/test/unit/addressResolvers/index.test.ts b/test/unit/addressResolvers/index.test.ts index 273d3480..56d543ad 100644 --- a/test/unit/addressResolvers/index.test.ts +++ b/test/unit/addressResolvers/index.test.ts @@ -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); }); @@ -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' @@ -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' + }); }); }); });