diff --git a/packages/toolkit/src/query/tests/errorHandling.test.tsx b/packages/toolkit/src/query/tests/errorHandling.test.tsx index 1aef06d514..6b59998174 100644 --- a/packages/toolkit/src/query/tests/errorHandling.test.tsx +++ b/packages/toolkit/src/query/tests/errorHandling.test.tsx @@ -34,14 +34,17 @@ const failQueryOnce = rest.get('/query', (_, req, ctx) => ) describe('fetchBaseQuery', () => { - const commonBaseQueryApiArgs: BaseQueryApi = { - signal: new AbortController().signal, - dispatch: storeRef.store.dispatch, - getState: storeRef.store.getState, - extra: undefined, - type: 'query', - endpoint: 'doesntmatterhere', - } + let commonBaseQueryApiArgs: BaseQueryApi = {} as any + beforeEach(() => { + commonBaseQueryApiArgs = { + signal: new AbortController().signal, + dispatch: storeRef.store.dispatch, + getState: storeRef.store.getState, + extra: undefined, + type: 'query', + endpoint: 'doesntmatterhere', + } + }) test('success', async () => { await expect( baseQuery('/success', commonBaseQueryApiArgs, {}) diff --git a/packages/toolkit/src/query/tests/fetchBaseQuery.test.tsx b/packages/toolkit/src/query/tests/fetchBaseQuery.test.tsx index 43ea30cb04..eb6b6bbc2a 100644 --- a/packages/toolkit/src/query/tests/fetchBaseQuery.test.tsx +++ b/packages/toolkit/src/query/tests/fetchBaseQuery.test.tsx @@ -79,8 +79,8 @@ beforeEach(() => { dispatch: storeRef.store.dispatch, getState: storeRef.store.getState, extra: undefined, - endpoint: '', type: 'query', + endpoint: 'doesntmatterhere', } })