From dc4467e0ad4f122c5e8fa9591a99daeb0545377a Mon Sep 17 00:00:00 2001 From: Paul Cramer Date: Mon, 10 Mar 2025 16:01:09 -0700 Subject: [PATCH] lint --- src/identity/utils/getNames.test.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/identity/utils/getNames.test.ts b/src/identity/utils/getNames.test.ts index d724f8b21e..06d0ae0078 100644 --- a/src/identity/utils/getNames.test.ts +++ b/src/identity/utils/getNames.test.ts @@ -183,4 +183,25 @@ describe('getNames', () => { consoleSpy.mockRestore(); }); + + it('should handle errors during batch ENS resolution process', async () => { + const originalPromiseAll = Promise.all; + global.Promise.all = vi.fn().mockImplementation(() => { + throw new Error('Batch ENS resolution failed'); + }); + + const consoleSpy = vi.spyOn(console, 'error').mockImplementation(() => {}); + + const names = await getNames({ addresses: walletAddresses }); + + expect(names).toEqual([null, null, null]); + + expect(consoleSpy).toHaveBeenCalledWith( + 'Error resolving ENS names in batch:', + expect.any(Error), + ); + + global.Promise.all = originalPromiseAll; + consoleSpy.mockRestore(); + }); });