|
1 | | -import { configureStore, isAllOf } from '@reduxjs/toolkit' |
2 | | -import { |
3 | | - act, |
4 | | - fireEvent, |
5 | | - render, |
6 | | - renderHook, |
7 | | - screen, |
8 | | - waitFor, |
9 | | -} from '@testing-library/react' |
10 | | -import userEvent from '@testing-library/user-event' |
11 | | -import { HttpResponse, delay, http } from 'msw' |
12 | | -import util from 'util' |
13 | | -import type { |
14 | | - InfiniteQueryActionCreatorResult, |
15 | | - QueryCacheKey, |
16 | | -} from '@reduxjs/toolkit/query/react' |
| 1 | +import { server } from '@internal/query/tests/mocks/server' |
| 2 | +import type { InfiniteQueryActionCreatorResult } from '@reduxjs/toolkit/query/react' |
17 | 3 | import { |
18 | 4 | QueryStatus, |
19 | 5 | createApi, |
20 | | - fetchBaseQuery, |
21 | 6 | fakeBaseQuery, |
22 | | - skipToken, |
| 7 | + fetchBaseQuery, |
23 | 8 | } from '@reduxjs/toolkit/query/react' |
24 | | -import { |
25 | | - actionsReducer, |
26 | | - setupApiStore, |
27 | | - withProvider, |
28 | | -} from '../../tests/utils/helpers' |
29 | | -import type { BaseQueryApi } from '../baseQueryTypes' |
30 | | -import { server } from '@internal/query/tests/mocks/server' |
| 9 | +import { HttpResponse, delay, http } from 'msw' |
| 10 | +import { actionsReducer, setupApiStore } from '../../tests/utils/helpers' |
31 | 11 | import type { InfiniteQueryResultFlags } from '../core/buildSelectors' |
32 | 12 |
|
33 | 13 | describe('Infinite queries', () => { |
@@ -171,12 +151,6 @@ describe('Infinite queries', () => { |
171 | 151 |
|
172 | 152 | hitCounter = 0 |
173 | 153 | queryCounter = 0 |
174 | | - |
175 | | - process.env.NODE_ENV = 'development' |
176 | | - }) |
177 | | - |
178 | | - afterEach(() => { |
179 | | - process.env.NODE_ENV = 'test' |
180 | 154 | }) |
181 | 155 |
|
182 | 156 | type InfiniteQueryResult = Awaited<InfiniteQueryActionCreatorResult<any>> |
@@ -387,6 +361,8 @@ describe('Infinite queries', () => { |
387 | 361 | }) |
388 | 362 |
|
389 | 363 | test('validates maxPages during createApi call', async () => { |
| 364 | + vi.stubEnv('NODE_ENV', 'development') |
| 365 | + |
390 | 366 | const createApiWithMaxPages = ( |
391 | 367 | maxPages: number, |
392 | 368 | getPreviousPageParam: (() => number) | undefined, |
|
0 commit comments