Skip to content

Commit 3a0ff4a

Browse files
committed
chore: delete an old, flaky test that doesn't test much
1 parent 2bea830 commit 3a0ff4a

File tree

2 files changed

+0
-61
lines changed

2 files changed

+0
-61
lines changed

packages/react-query/src/__tests__/useQuery.test.tsx

-28
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818
import type {
1919
DefinedUseQueryResult,
2020
QueryFunction,
21-
QueryFunctionContext,
2221
UseQueryOptions,
2322
UseQueryResult,
2423
} from '..'
@@ -2437,33 +2436,6 @@ describe('useQuery', () => {
24372436
rendered.getByText('status: pending')
24382437
})
24392438

2440-
// See https://github.com/tannerlinsley/react-query/issues/147
2441-
it('should not pass stringified variables to query function', async () => {
2442-
const key = queryKey()
2443-
const variables = { number: 5, boolean: false, object: {}, array: [] }
2444-
type CustomQueryKey = [typeof key, typeof variables]
2445-
const states: UseQueryResult<CustomQueryKey>[] = []
2446-
2447-
const queryFn = async (ctx: QueryFunctionContext<CustomQueryKey>) => {
2448-
await sleep(10)
2449-
return ctx.queryKey
2450-
}
2451-
2452-
function Page() {
2453-
const state = useQuery({ queryKey: [key, variables], queryFn })
2454-
states.push(state)
2455-
return <div>{state.status}</div>
2456-
}
2457-
2458-
const rendered = renderWithClient(queryClient, <Page />)
2459-
2460-
await waitFor(() => {
2461-
rendered.getByText('success')
2462-
})
2463-
2464-
expect(states[1]?.data).toEqual([key, variables])
2465-
})
2466-
24672439
it('should not refetch query on focus when `enabled` is set to `false`', async () => {
24682440
const key = queryKey()
24692441
const queryFn = vi.fn<unknown[], string>().mockReturnValue('data')

packages/solid-query/src/__tests__/createQuery.test.tsx

-33
Original file line numberDiff line numberDiff line change
@@ -2129,39 +2129,6 @@ describe('createQuery', () => {
21292129
screen.getByText('status: pending')
21302130
})
21312131

2132-
// See https://github.com/tannerlinsley/react-query/issues/147
2133-
it('should not pass stringified variables to query function', async () => {
2134-
const key = queryKey()
2135-
const variables = { number: 5, boolean: false, object: {}, array: [] }
2136-
type CustomQueryKey = readonly [typeof key, typeof variables]
2137-
const states: CreateQueryResult<CustomQueryKey, unknown>[] = []
2138-
2139-
function Page() {
2140-
const state = createQuery(() => ({
2141-
queryKey: [key, variables] as const,
2142-
queryFn: async (ctx) => {
2143-
await sleep(10)
2144-
return ctx.queryKey
2145-
},
2146-
}))
2147-
2148-
createRenderEffect(() => {
2149-
states.push({ ...state })
2150-
})
2151-
return null
2152-
}
2153-
2154-
render(() => (
2155-
<QueryClientProvider client={queryClient}>
2156-
<Page />
2157-
</QueryClientProvider>
2158-
))
2159-
2160-
await sleep(20)
2161-
2162-
expect(states[1]?.data).toEqual([key, variables])
2163-
})
2164-
21652132
it('should not refetch query on focus when `enabled` is set to `false`', async () => {
21662133
const key = queryKey()
21672134
const queryFn = vi.fn<unknown[], string>().mockReturnValue('data')

0 commit comments

Comments
 (0)