add a test for when attemptLegacyImport encounters an error

This commit is contained in:
41666 2022-02-02 13:57:00 -05:00
parent c7bfed8bae
commit 7007cfea9d

View file

@ -191,6 +191,18 @@ describe('getGuildData', () => {
await getGuildData(config, '123');
expect(mockFetchLegacyServer).toHaveBeenCalledTimes(1);
});
it('errors gracefully', async () => {
const [config] = configContext();
mockFetchLegacyServer.mockImplementationOnce(() => {
throw new Error('test');
});
await getGuildData(config, '123');
await getGuildData(config, '123');
expect(mockFetchLegacyServer).toHaveBeenCalledTimes(1);
});
});
});