@@ -167,11 +167,6 @@ describe('header handling', () => {
167167
168168 request = new FetchRequest ( "get" , "localhost" )
169169 expect ( request . fetchOptions . redirect ) . toBe ( "follow" )
170-
171- // maybe check for valid values and default to follow?
172- // https://developer.mozilla.org/en-US/docs/Web/API/Request/redirect
173- request = new FetchRequest ( "get" , "localhost" , { redirect : "nonsense" } )
174- expect ( request . fetchOptions . redirect ) . toBe ( "nonsense" )
175170 } )
176171
177172 test ( 'sets signal' , ( ) => {
@@ -196,10 +191,14 @@ describe('header handling', () => {
196191
197192describe ( 'query params are parsed' , ( ) => {
198193 test ( 'anchors are rejected' , ( ) => {
199- const testRequest = new FetchRequest ( "post" , "localhost/test?a=1&b=2#anchor" , { query : { c : 3 } } )
200- expect ( testRequest . url ) . toBe ( "localhost/test?a=1&b=2&c=3" )
201- // const brokenRequest = new FetchRequest("post", "localhost/test#anchor", { query: { a: 1, b: 2, c: 3 } })
202- // expect(brokenRequest.url).toBe("localhost/test?a=1&b=2&c=3")
194+ const mixedRequest = new FetchRequest ( "post" , "localhost/test?a=1&b=2#anchor" , { query : { c : 3 } } )
195+ expect ( mixedRequest . url ) . toBe ( "localhost/test?a=1&b=2&c=3" )
196+
197+ const queryRequest = new FetchRequest ( "post" , "localhost/test?a=1&b=2&c=3#anchor" )
198+ expect ( queryRequest . url ) . toBe ( "localhost/test?a=1&b=2&c=3" )
199+
200+ const optionsRequest = new FetchRequest ( "post" , "localhost/test#anchor" , { query : { a : 1 , b : 2 , c : 3 } } )
201+ expect ( optionsRequest . url ) . toBe ( "localhost/test?a=1&b=2&c=3" )
203202 } )
204203 test ( 'url and options are merged' , ( ) => {
205204 const urlAndOptionRequest = new FetchRequest ( "post" , "localhost/test?a=1&b=2" , { query : { c : 3 } } )
0 commit comments