mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-24 19:39:11 +00:00
add a test for when attemptLegacyImport encounters an error
This commit is contained in:
parent
c7bfed8bae
commit
7007cfea9d
1 changed files with 12 additions and 0 deletions
|
@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue