Fixed pokedexApi.test.ts

develop
Jason Zhu 2023-04-12 23:24:29 +10:00
parent 92f7111943
commit 88fb450c5a
1 changed files with 6 additions and 2 deletions

View File

@ -3,8 +3,9 @@ import { pokedexSlice } from 'features/Pokedex/pokedexSlice';
import { configureStore } from '@reduxjs/toolkit'; import { configureStore } from '@reduxjs/toolkit';
import region1 from 'features/Pokedex/__test__/responses/region1.json'; import region1 from 'features/Pokedex/__test__/responses/region1.json';
import pokemon1 from 'features/Pokedex/__test__/responses/pokemon1.json'; import pokemon1 from 'features/Pokedex/__test__/responses/pokemon1.json';
import { AppStore } from 'app/store';
import { RegionListResponseData, TypeListResponseData } from '../types/api'; import { RegionListResponseData, TypeListResponseData } from '../types/api';
import { AppStore } from 'app/store';
import { listenerMiddleware } from '../../../app/listenerMiddleware';
let store: AppStore; let store: AppStore;
describe('pokedexApi', () => { describe('pokedexApi', () => {
@ -15,7 +16,10 @@ describe('pokedexApi', () => {
[pokedexApi.reducerPath]: pokedexApi.reducer, [pokedexApi.reducerPath]: pokedexApi.reducer,
}, },
middleware: getDefaultMiddleware => middleware: getDefaultMiddleware =>
getDefaultMiddleware().concat(pokedexApi.middleware), getDefaultMiddleware().concat(
pokedexApi.middleware,
listenerMiddleware.middleware,
),
}); });
}); });