@@ -8,8 +8,6 @@ import type {
8
8
UndefinedInitialDataInfiniteOptions ,
9
9
} from '../infiniteQueryOptions'
10
10
11
- const doNotRun = ( _callback : ( ) => void ) => { }
12
-
13
11
describe ( 'infiniteQueryOptions' , ( ) => {
14
12
it ( 'should infer defined types' , ( ) => {
15
13
const options = infiniteQueryOptions ( {
@@ -23,27 +21,25 @@ describe('infiniteQueryOptions', () => {
23
21
initialPageParam : 0 ,
24
22
} )
25
23
26
- doNotRun ( ( ) => {
27
- expectTypeOf ( useInfiniteQuery ( ( ) => options ) . data ) . toEqualTypeOf <
28
- InfiniteData < { wow : boolean } , unknown >
29
- > ( )
24
+ expectTypeOf ( useInfiniteQuery ( ( ) => options ) . data ) . toEqualTypeOf <
25
+ InfiniteData < { wow : boolean } , unknown >
26
+ > ( )
30
27
31
- expectTypeOf ( options ) . toMatchTypeOf <
32
- ReturnType <
33
- DefinedInitialDataInfiniteOptions <
34
- { wow : boolean } ,
35
- Error ,
36
- InfiniteData < { wow : boolean } , unknown > ,
37
- Array < string > ,
38
- number | undefined
39
- >
28
+ expectTypeOf ( options ) . toMatchTypeOf <
29
+ ReturnType <
30
+ DefinedInitialDataInfiniteOptions <
31
+ { wow : boolean } ,
32
+ Error ,
33
+ InfiniteData < { wow : boolean } , unknown > ,
34
+ Array < string > ,
35
+ number | undefined
40
36
>
41
- > ( )
37
+ >
38
+ > ( )
42
39
43
- expectTypeOf ( options . queryKey [ dataTagSymbol ] ) . toEqualTypeOf <
44
- InfiniteData < { wow : boolean } >
45
- > ( )
46
- } )
40
+ expectTypeOf ( options . queryKey [ dataTagSymbol ] ) . toEqualTypeOf <
41
+ InfiniteData < { wow : boolean } >
42
+ > ( )
47
43
} )
48
44
49
45
it ( 'should work without defined types' , ( ) => {
@@ -54,28 +50,26 @@ describe('infiniteQueryOptions', () => {
54
50
initialPageParam : 0 ,
55
51
} )
56
52
57
- doNotRun ( ( ) => {
58
- expectTypeOf ( ( ) => useInfiniteQuery ( ( ) => options ) . data ) . toEqualTypeOf <
59
- ( ) => InfiniteData < { wow : boolean } , unknown > | undefined
60
- > ( )
53
+ expectTypeOf ( ( ) => useInfiniteQuery ( ( ) => options ) . data ) . toEqualTypeOf <
54
+ ( ) => InfiniteData < { wow : boolean } , unknown > | undefined
55
+ > ( )
61
56
62
- expectTypeOf ( options ) . toMatchTypeOf <
63
- ReturnType <
64
- UndefinedInitialDataInfiniteOptions <
65
- { wow : boolean } ,
66
- Error ,
67
- InfiniteData < { wow : boolean } , unknown > ,
68
- Array < string > ,
69
- number
70
- >
57
+ expectTypeOf ( options ) . toMatchTypeOf <
58
+ ReturnType <
59
+ UndefinedInitialDataInfiniteOptions <
60
+ { wow : boolean } ,
61
+ Error ,
62
+ InfiniteData < { wow : boolean } , unknown > ,
63
+ Array < string > ,
64
+ number
71
65
>
72
- > ( )
66
+ >
67
+ > ( )
73
68
74
- expectTypeOf ( options . queryKey [ dataTagSymbol ] ) . toEqualTypeOf <
75
- InfiniteData < {
76
- wow : boolean
77
- } >
78
- > ( )
79
- } )
69
+ expectTypeOf ( options . queryKey [ dataTagSymbol ] ) . toEqualTypeOf <
70
+ InfiniteData < {
71
+ wow : boolean
72
+ } >
73
+ > ( )
80
74
} )
81
75
} )
0 commit comments