diff --git a/src/__tests__/react/create-mutation.test.ts b/src/__tests__/react/create-mutation.test.ts index 55e83c5..7dca840 100644 --- a/src/__tests__/react/create-mutation.test.ts +++ b/src/__tests__/react/create-mutation.test.ts @@ -12,7 +12,7 @@ describe('createMutation - without param', () => { beforeEach(() => { mutationFn = jest.fn().mockImplementation(async () => { return new Promise((resolve) => { - setTimeout(() => resolve({ status: 'success' }), 33); + setTimeout(() => resolve({ status: 'success' }), 44); }); }); useMutation = createMutation(mutationFn); @@ -68,7 +68,7 @@ describe('createMutation - with param', () => { beforeEach(() => { mutationFn = jest.fn().mockImplementation(async (param) => { return new Promise((resolve) => { - setTimeout(() => resolve({ status: 'success', id: param.id }), 33); + setTimeout(() => resolve({ status: 'success', id: param.id }), 44); }); }); useMutation = createMutation(mutationFn); @@ -133,7 +133,7 @@ describe('createMutation - with param', () => { } else { resolve({ status: 'success', id: param.id }); } - }, 33); + }, 44); }); }); useMutation = createMutation(mutationFn); @@ -201,7 +201,7 @@ describe('createMutation - with param', () => { } else { resolve({ status: 'success', id: param.id }); } - }, 33); + }, 44); }); }); useMutation = createMutation(mutationFn, { diff --git a/src/__tests__/react/create-query/infinite-query.test.ts b/src/__tests__/react/create-query/infinite-query.test.ts index 087b399..31e7a09 100644 --- a/src/__tests__/react/create-query/infinite-query.test.ts +++ b/src/__tests__/react/create-query/infinite-query.test.ts @@ -30,7 +30,7 @@ describe('createQuery - infinite query', () => { } if (responses2[page]) resolve(responses2[page]); else reject(new Error('Test error')); - }, 33); + }, 44); }); }); useQuery = createQuery((_, { pageParam = 1 }) => queryFn({ page: pageParam }), { diff --git a/src/__tests__/react/create-query/single-query.test.ts b/src/__tests__/react/create-query/single-query.test.ts index fdf1452..c3df501 100644 --- a/src/__tests__/react/create-query/single-query.test.ts +++ b/src/__tests__/react/create-query/single-query.test.ts @@ -14,7 +14,7 @@ describe('createQuery - single query', () => { beforeEach(() => { queryFn = jest.fn().mockImplementation(async () => { return new Promise((resolve) => { - setTimeout(() => resolve({ id: 1, name: 'test' }), 33); + setTimeout(() => resolve({ id: 1, name: 'test' }), 44); }); }); useQuery = createQuery(queryFn); @@ -60,7 +60,7 @@ describe('createQuery - single query', () => { queryFn = jest.fn().mockImplementation(async () => { // Always error return new Promise((_resolve, reject) => { - setTimeout(() => reject(new Error('Test error')), 33); + setTimeout(() => reject(new Error('Test error')), 44); }); }); useQuery = createQuery(queryFn); @@ -68,7 +68,7 @@ describe('createQuery - single query', () => { const hook1 = renderHook(() => useQuery()); const hook2 = renderHook(() => useQuery()); - const fetchingAndRetryDelay = 33 + 1000; + const fetchingAndRetryDelay = 44 + 1000; await hook1.waitForNextUpdate({ timeout: 2 * fetchingAndRetryDelay + 300 }); const { current } = hook1.result; @@ -100,7 +100,7 @@ describe('createQuery - single query', () => { } else { resolve({ id: 1, name: 'test' }); } - }, 33); + }, 44); }); }); useQuery = createQuery(queryFn, { retry: 3, retryDelay: 100 }); @@ -140,7 +140,7 @@ describe('createQuery - single query', () => { } else { resolve({ id: 1, name: 'test' }); } - }, 33); + }, 44); }); }); useQuery = createQuery(queryFn, { retryDelay: 100 }); @@ -194,7 +194,7 @@ describe('createQuery - single query', () => { } else { resolve({ id: 1, name: 'test' }); } - }, 33); + }, 44); }); }); useQuery = createQuery(queryFn, { @@ -241,7 +241,7 @@ describe('createQuery - single query', () => { } else { resolve({ id: 1, name: 'test 2' }); } - }, 33); + }, 44); }); }); useQuery = createQuery(queryFn); @@ -359,7 +359,7 @@ describe('createQuery - single query', () => { setTimeout(() => { const name = ['', 'A', 'B', 'C', 'D'][id]; resolve({ id, name }); - }, 33); + }, 44); }); }); useQuery = createQuery(queryFn); @@ -389,7 +389,7 @@ describe('createQuery - single query', () => { } } resolve({ id, name }); - }, 33); + }, 44); }); }); useQuery = createQuery(queryFn, { @@ -466,7 +466,7 @@ describe('createQuery - single query', () => { const queryFn2 = jest.fn().mockImplementation(async ({ id }) => { return new Promise((resolve) => { - setTimeout(() => resolve({ id, name: 'test' }), 33); + setTimeout(() => resolve({ id, name: 'test' }), 44); }); }); @@ -488,7 +488,7 @@ describe('createQuery - single query', () => { expect(queryFn2).toHaveBeenCalledTimes(1); await act(async () => { - await new Promise((r) => setTimeout(r, 33)); + await new Promise((r) => setTimeout(r, 100)); fireEvent(window, new Event('focus')); }); await hook2.waitForNextUpdate(); @@ -497,7 +497,7 @@ describe('createQuery - single query', () => { hook2.unmount(); await act(async () => { - await new Promise((r) => setTimeout(r, 33)); + await new Promise((r) => setTimeout(r, 100)); fireEvent(window, new Event('focus')); }); await hook1.waitForNextUpdate();