Skip to content
Source
Sign inSign up
TanStack/query

test: startTransition #8444

ClosedTkDodowants to merge 2 commits intomain fromrefs/pull/8444/headopened View on GitHub

Showing 1 changed file with 97 additions and 0 deletions.

x
0 of 1 viewed, 1 left
97 additions and 0 deletionspackages/react-query/src/__tests__/transition.test.tsxAdded
View file
@@ -0,0 +1,97 @@
+import { afterAll, beforeAll, describe, expect, it } from 'vitest'
+import * as React from 'react'
+import {
+ createRenderStream,
+ useTrackRenders,
+} from '@testing-library/react-render-stream'
+import { QueryClientProvider, useQuery } from '..'
+import { QueryCache } from '../index'
+import { createQueryClient, queryKey, sleep } from './utils'
+​
+describe('react transitions', () => {
+ const queryCache = new QueryCache()
+ const queryClient = createQueryClient({
+ queryCache,
+ })
+​
+ beforeAll(() => {
+ queryClient.setDefaultOptions({
+ queries: { experimental_prefetchInRender: true },
+ })
+ })
+ afterAll(() => {
+ queryClient.setDefaultOptions({
+ queries: { experimental_prefetchInRender: false },
+ })
+ })
+​