check that we only fetch legacy once, ever

This commit is contained in:
41666 2022-01-30 03:28:20 -05:00
parent a3691fa112
commit 8e21d2e5cc

View file

@ -181,6 +181,16 @@ describe('getGuildData', () => {
const storedGuildData = await config.kv.guildData.get('123');
expect(storedGuildData).toMatchObject(expectedGuildData);
});
it('fails an import and prevents re-fetch', async () => {
const [config] = configContext();
mockFetchLegacyServer.mockReturnValue(null);
await getGuildData(config, '123');
await getGuildData(config, '123');
expect(mockFetchLegacyServer).toHaveBeenCalledTimes(1);
});
});
});