Temporarily increase timeout for network call in test

This commit is contained in:
Jia Hao 2021-01-30 04:49:36 +00:00 committed by GitHub
parent 9c784dcfaf
commit 66ff02584e
1 changed files with 7 additions and 6 deletions

View File

@ -9,13 +9,14 @@ const EXPECTED_USERAGENTS = {
};
describe('Infer User Agent', () => {
test('Can infer userAgent for all platforms', async () => {
jest.setTimeout(10000);
for (const [arch, archUa] of Object.entries(EXPECTED_USERAGENTS)) {
const ua = await inferUserAgent(DEFAULT_ELECTRON_VERSION, arch);
// TODO make fast by mocking timeout.
for (const [platform, archUa] of Object.entries(EXPECTED_USERAGENTS)) {
test(`Can infer userAgent for ${platform}`, async () => {
jest.setTimeout(10000);
const ua = await inferUserAgent(DEFAULT_ELECTRON_VERSION, platform);
expect(ua).toBe(archUa);
}
});
});
}
// TODO make fast by mocking timeout, and un-skip
test.skip('Connection error will still get a user agent', async () => {