@@ -133,7 +133,7 @@ describe('useFetch - BROWSER - basic functionality', (): void => {
133133} )
134134
135135describe ( 'useFetch - handling host/path/route parsing properly' , ( ) : void => {
136- it ( 'should have addSlash run properly' , ( ) : void => {
136+ it ( 'should have addSlash run properly' , ( ) : void => {
137137 expect ( addSlash ( '' , '' ) ) . toBe ( '' )
138138 expect ( addSlash ( '' ) ) . toBe ( '' )
139139 expect ( addSlash ( '?foo=bar' , 'a.com' ) ) . toBe ( '?foo=bar' )
@@ -145,6 +145,9 @@ describe('useFetch - handling host/path/route parsing properly', (): void => {
145145 expect ( addSlash ( 'foo' , 'a.com/' ) ) . toBe ( 'foo' )
146146 expect ( addSlash ( 'foo' ) ) . toBe ( '/foo' )
147147 expect ( addSlash ( '/foo' ) ) . toBe ( '/foo' )
148+ expect ( addSlash ( 'bar' , 'a.com?foo=' ) ) . toBe ( 'bar' )
149+ expect ( addSlash ( '&foo=bar' , 'a.com?b=k' ) ) . toBe ( '&foo=bar' )
150+ expect ( addSlash ( '&foo=bar' ) ) . toBe ( '&foo=bar' )
148151 } )
149152} )
150153
@@ -159,7 +162,7 @@ describe('useFetch - responseType', (): void => {
159162 fetch . resetMocks ( )
160163 fetch . mockResponseOnce ( 'Alex Cory' )
161164 const { result, waitForNextUpdate } = renderHook (
162- ( ) => useFetch ( 'a-fake-url' , { data : '' , responseType : 'json' } , [ ] ) , // onMount === true
165+ ( ) => useFetch ( 'a-fake-url' , { data : '' , responseType : 'json' } , [ ] ) // onMount === true
163166 )
164167 expect ( result . current . data ) . toEqual ( '' )
165168 expect ( result . current . loading ) . toBe ( true )
@@ -174,7 +177,7 @@ describe('useFetch - responseType', (): void => {
174177 const expectedString = 'Alex Cory'
175178 fetch . mockResponseOnce ( JSON . stringify ( expectedString ) )
176179 const { result, waitForNextUpdate } = renderHook (
177- ( ) => useFetch ( 'a-fake-url' , { data : '' } , [ ] ) , // onMount === true
180+ ( ) => useFetch ( 'a-fake-url' , { data : '' } , [ ] ) // onMount === true
178181 )
179182 expect ( result . current . data ) . toEqual ( '' )
180183 expect ( result . current . loading ) . toBe ( true )
@@ -203,7 +206,7 @@ describe('useFetch - BROWSER - with <Provider />', (): void => {
203206 fetch . mockResponseOnce ( JSON . stringify ( expected ) )
204207 } )
205208
206- it ( ` should work correctly: useFetch({ data: [] }, [])` , async ( ) : Promise < void > => {
209+ it ( ' should work correctly: useFetch({ data: [] }, [])' , async ( ) : Promise < void > => {
207210 const { result, waitForNextUpdate } = renderHook (
208211 ( ) => useFetch ( { data : { } } , [ ] ) , // onMount === true
209212 { wrapper }
@@ -294,7 +297,7 @@ describe('useFetch - BROWSER - with <Provider />', (): void => {
294297 expect ( fetch . mock . calls . length ) . toBe ( 2 )
295298 } )
296299
297- it ( ` should execute GET using Provider url: useFetch('/people', [])` , async ( ) : Promise <
300+ it ( ' should execute GET using Provider url: useFetch(\ '/people\ ', [])' , async ( ) : Promise <
298301 void
299302 > => {
300303 const { result, waitForNextUpdate } = renderHook (
@@ -711,7 +714,7 @@ describe('useFetch - BROWSER - interceptors', (): void => {
711714 return response
712715 }
713716 }
714- } , [ ] ) ,
717+ } , [ ] )
715718 )
716719 await waitForNextUpdate ( )
717720 await act ( result . current . get )
@@ -1138,7 +1141,7 @@ describe('useFetch - BROWSER - errors', (): void => {
11381141 } )
11391142
11401143 it ( 'should set the `error` with custom errors' , async ( ) : Promise < void > => {
1141- const customError = { id : 'Custom Error' }
1144+ const customError = { id : 'Custom Error' }
11421145 fetch . resetMocks ( )
11431146 fetch . mockResponse ( ( ) => Promise . reject ( customError ) )
11441147 const { result } = renderHook (
0 commit comments