Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcramer committed Mar 10, 2025
1 parent d26902b commit dc4467e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/identity/utils/getNames.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});

0 comments on commit dc4467e

Please sign in to comment.