@@ -557,7 +557,7 @@ describe('useFetch - BROWSER - interceptors', (): void => {
557557 const wrapper = ( { children } : { children ?: ReactNode } ) : ReactElement => {
558558 const options : Options = {
559559 interceptors : {
560- request : async ( opts , url , path , route ) => {
560+ request : async ( { options : opts , url, path, route } ) => {
561561 if ( path === '/path' ) {
562562 opts . data = 'path'
563563 }
@@ -569,7 +569,7 @@ describe('useFetch - BROWSER - interceptors', (): void => {
569569 }
570570 return opts
571571 } ,
572- async response ( res ) {
572+ async response ( { response : res } ) {
573573 if ( res . data ) res . data = toCamel ( res . data )
574574 return res
575575 }
@@ -645,11 +645,11 @@ describe('useFetch - BROWSER - interceptors', (): void => {
645645 const { result, waitForNextUpdate } = renderHook (
646646 ( ) => useFetch ( 'url' , {
647647 interceptors : {
648- async request ( options ) {
648+ async request ( { options } ) {
649649 requestCalled ++
650650 return options
651651 } ,
652- async response ( response ) {
652+ async response ( { response } ) {
653653 responseCalled ++
654654 return response
655655 }
@@ -1066,9 +1066,9 @@ describe('useFetch - BROWSER - errors', (): void => {
10661066 const wrapperCustomError = ( { children } : { children ?: ReactNode } ) : ReactElement => {
10671067 const options = {
10681068 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
10721072 }
10731073 } ,
10741074 cachePolicy : NO_CACHE
0 commit comments