@@ -99,13 +99,13 @@ describe('endpoint types', () => {
99
99
} ) ;
100
100
101
101
it ( 'should work with everything correct' , async ( ) => {
102
- const { result, waitForNextUpdate } = renderRestHook ( ( ) => {
102
+ const { result } = renderRestHook ( ( ) => {
103
103
return useFetcher ( TypedArticleResource . update ( ) ) ;
104
104
} ) ;
105
105
const a = await result . current ( { id : payload . id } , { title : 'hi' } ) ;
106
106
} ) ;
107
107
it ( 'should error on invalid payload' , async ( ) => {
108
- const { result, waitForNextUpdate } = renderRestHook ( ( ) => {
108
+ const { result } = renderRestHook ( ( ) => {
109
109
return useFetcher ( TypedArticleResource . update ( ) ) ;
110
110
} ) ;
111
111
// @ts -expect-error
@@ -119,11 +119,11 @@ describe('endpoint types', () => {
119
119
const { result, waitForNextUpdate } = renderRestHook ( ( ) => {
120
120
return useFetcher ( TypedArticleResource . update ( ) ) ;
121
121
} ) ;
122
- // @ts -expect-error
123
- await expect ( result . current ( { id : 'hi' } , { title : 'hi' } ) ) . rejects ;
124
- console . log ( 'post reject' ) ;
125
- await waitForNextUpdate ( ) ;
126
- console . log ( 'post update' ) ;
122
+
123
+ await expect (
124
+ // @ts -expect-error
125
+ result . current ( { id : 'hi' } , { title : 'hi' } ) ,
126
+ ) . rejects . toEqual ( expect . any ( Error ) ) ;
127
127
} ) ;
128
128
} ) ;
129
129
}
0 commit comments