@@ -557,7 +557,7 @@ describe('useFetch - BROWSER - interceptors', (): void => {
557
557
const wrapper = ( { children } : { children ?: ReactNode } ) : ReactElement => {
558
558
const options : Options = {
559
559
interceptors : {
560
- request : async ( opts , url , path , route ) => {
560
+ request : async ( { options : opts , url, path, route } ) => {
561
561
if ( path === '/path' ) {
562
562
opts . data = 'path'
563
563
}
@@ -569,7 +569,7 @@ describe('useFetch - BROWSER - interceptors', (): void => {
569
569
}
570
570
return opts
571
571
} ,
572
- async response ( res ) {
572
+ async response ( { response : res } ) {
573
573
if ( res . data ) res . data = toCamel ( res . data )
574
574
return res
575
575
}
@@ -645,11 +645,11 @@ describe('useFetch - BROWSER - interceptors', (): void => {
645
645
const { result, waitForNextUpdate } = renderHook (
646
646
( ) => useFetch ( 'url' , {
647
647
interceptors : {
648
- async request ( options ) {
648
+ async request ( { options } ) {
649
649
requestCalled ++
650
650
return options
651
651
} ,
652
- async response ( response ) {
652
+ async response ( { response } ) {
653
653
responseCalled ++
654
654
return response
655
655
}
@@ -1066,9 +1066,9 @@ describe('useFetch - BROWSER - errors', (): void => {
1066
1066
const wrapperCustomError = ( { children } : { children ?: ReactNode } ) : ReactElement => {
1067
1067
const options = {
1068
1068
interceptors : {
1069
- async response ( res : Res < any > ) : Promise < Res < any > > {
1070
- if ( ! res . ok ) throw expectedError
1071
- return res
1069
+ async response < TData = any > ( { response } : { response : Res < TData > } ) : Promise < Res < TData > > {
1070
+ if ( ! response . ok ) throw expectedError
1071
+ return response
1072
1072
}
1073
1073
} ,
1074
1074
cachePolicy : NO_CACHE
0 commit comments