1import { wrapFetchWithOffline } from '../wrapFetchWithOffline';
2
3describe(wrapFetchWithOffline, () => {
4  it(`supports normal requests`, async () => {
5    delete process.env.EXPO_OFFLINE;
6    const input = jest.fn();
7    const next = wrapFetchWithOffline(input);
8    await next('https://example.com/', {});
9    expect(input).toBeCalledWith('https://example.com/', {});
10  });
11  it(`times out instantly when offline`, async () => {
12    process.env.EXPO_OFFLINE = '1';
13    const input = jest.fn();
14    const next = wrapFetchWithOffline(input);
15    await next('https://example.com/', {});
16    expect(input).toBeCalledWith('https://example.com/', { timeout: 1 });
17  });
18});
19