@@ -43,10 +43,10 @@ const accessorTests = [{
4343} , {
4444 // Setting href to non-null non-string coerces to string
4545 url : 'google' ,
46- set : { href : 0 } ,
46+ set : { href : undefined } ,
4747 test : {
48- path : '0 ' ,
49- href : '0 '
48+ path : 'undefined ' ,
49+ href : 'undefined '
5050 }
5151} , {
5252 // Setting port is reflected in host
@@ -180,8 +180,8 @@ const accessorTests = [{
180180 url : 'http://www.google.com' ,
181181 set : { search : '' } ,
182182 test : {
183- search : null ,
184- path : '/'
183+ search : '?' ,
184+ path : '/? '
185185 }
186186} , {
187187
@@ -203,11 +203,10 @@ const accessorTests = [{
203203} , {
204204
205205 // Empty hash is ok
206- url : 'http://www.google.com#hash ' ,
206+ url : 'http://www.google.com' ,
207207 set : { hash : '' } ,
208208 test : {
209- hash : null ,
210- href : 'http://www.google.com/'
209+ hash : '#'
211210 }
212211} , {
213212
@@ -253,8 +252,7 @@ const accessorTests = [{
253252 url : 'http://www.google.com' ,
254253 set : { pathname : '' } ,
255254 test : {
256- pathname : null ,
257- href : 'http://www.google.com'
255+ pathname : '/'
258256 }
259257} , {
260258 // Null path is ok
@@ -292,12 +290,11 @@ const accessorTests = [{
292290 protocol : null
293291 }
294292} , {
295- // Empty protocol is ok
293+ // Empty protocol is invalid
296294 url : 'http://www.google.com/path' ,
297295 set : { protocol : '' } ,
298296 test : {
299- protocol : null ,
300- href : '//www.google.com/path'
297+ protocol : 'http:'
301298 }
302299} , {
303300 // Set query to an object
@@ -330,9 +327,9 @@ const accessorTests = [{
330327 url : 'http://www.google.com/path?key=value' ,
331328 set : { path : '?key2=value2' } ,
332329 test : {
333- pathname : null ,
330+ pathname : '/' ,
334331 search : '?key2=value2' ,
335- href : 'http://www.google.com?key2=value2'
332+ href : 'http://www.google.com/ ?key2=value2'
336333 }
337334} , {
338335 // path is reflected in search and pathname 3
@@ -352,38 +349,6 @@ const accessorTests = [{
352349 search : null ,
353350 href : 'http://www.google.com'
354351 }
355- } , {
356- // setting hash to '' removes any hash
357- url : 'http://www.google.com/#hash' ,
358- set : { hash : '' } ,
359- test : {
360- hash : null ,
361- href : 'http://www.google.com/'
362- }
363- } , {
364- // setting hash to '#' removes any hash
365- url : 'http://www.google.com/#hash' ,
366- set : { hash : '#' } ,
367- test : {
368- hash : null ,
369- href : 'http://www.google.com/'
370- }
371- } , {
372- // setting search to '' removes any search
373- url : 'http://www.google.com/?search' ,
374- set : { search : '' } ,
375- test : {
376- search : null ,
377- href : 'http://www.google.com/'
378- }
379- } , {
380- // setting search to '?' removes any search
381- url : 'http://www.google.com/?search' ,
382- set : { search : '?' } ,
383- test : {
384- search : null ,
385- href : 'http://www.google.com/'
386- }
387352}
388353
389354] ;
0 commit comments