@@ -359,18 +359,20 @@ module.exports = function createTests(createHistory, name, reset = defaultReset)
359359 it ( 'updates the router even if path is the same' , ( ) => {
360360 const updates = [ ]
361361 const historyUnsubscribe = history . listen ( location => {
362- updates . push ( location . pathname ) ;
362+ updates . push ( location . pathname )
363363 } )
364364
365365 store . dispatch ( pushPath ( '/foo' ) )
366366 store . dispatch ( pushPath ( '/foo' ) )
367367 store . dispatch ( replacePath ( '/foo' ) )
368368
369- expect ( updates ) . toEqual ( [ '/' , '/foo' , '/foo' , '/foo' ] ) ;
369+ expect ( updates ) . toEqual ( [ '/' , '/foo' , '/foo' , '/foo' ] )
370+
371+ historyUnsubscribe ( )
370372 } )
371373
372374 it ( 'does not update the router for other state changes' , ( ) => {
373- const state = store . getState ( ) ;
375+ const state = store . getState ( )
374376
375377 store . dispatch ( {
376378 type : 'RANDOM_ACTION' ,
@@ -381,7 +383,7 @@ module.exports = function createTests(createHistory, name, reset = defaultReset)
381383 }
382384 } )
383385
384- expect ( state ) . toEqual ( store . getState ( ) ) ;
386+ expect ( state ) . toEqual ( store . getState ( ) )
385387 } )
386388
387389 it ( 'only updates the router once when dispatching from `listenBefore`' , ( ) => {
@@ -397,14 +399,14 @@ module.exports = function createTests(createHistory, name, reset = defaultReset)
397399 } )
398400 } )
399401
400- const updates = [ ] ;
402+ const updates = [ ]
401403 history . listen ( location => {
402- updates . push ( location . pathname ) ;
403- } ) ;
404+ updates . push ( location . pathname )
405+ } )
404406
405407 store . dispatch ( pushPath ( '/foo' ) )
406408
407- expect ( updates ) . toEqual ( [ '/' , '/foo' ] )
409+ expect ( updates ) . toEqual ( [ '/' , '/foo' ] )
408410 } )
409411
410412 it ( 'allows updating the route from within `listenBefore`' , ( ) => {
@@ -417,10 +419,10 @@ module.exports = function createTests(createHistory, name, reset = defaultReset)
417419 }
418420 } )
419421
420- const updates = [ ] ;
422+ const updates = [ ]
421423 history . listen ( location => {
422- updates . push ( location . pathname ) ;
423- } ) ;
424+ updates . push ( location . pathname )
425+ } )
424426
425427 store . dispatch ( pushPath ( '/foo' ) )
426428 expect ( store ) . toContainRoute ( {
@@ -434,7 +436,7 @@ module.exports = function createTests(createHistory, name, reset = defaultReset)
434436 replace : true
435437 } )
436438
437- expect ( updates ) . toEqual ( [ '/' , '/bar' , '/baz' ] ) ;
439+ expect ( updates ) . toEqual ( [ '/' , '/bar' , '/baz' ] )
438440 } )
439441
440442 it ( 'throws if "routing" key is missing with default selectRouteState' , ( ) => {
@@ -492,26 +494,26 @@ module.exports = function createTests(createHistory, name, reset = defaultReset)
492494 it ( 'only triggers history once when updating path via store' , ( ) => {
493495 const updates = [ ]
494496 const historyUnsubscribe = history . listen ( location => {
495- updates . push ( location . pathname ) ;
497+ updates . push ( location . pathname )
496498 } )
497499
498- store . dispatch ( pushPath ( '/bar' ) ) ;
499- store . dispatch ( pushPath ( '/baz' ) ) ;
500- expect ( updates ) . toEqual ( [ '/' , '/bar' , '/baz' ] )
500+ store . dispatch ( pushPath ( '/bar' ) )
501+ store . dispatch ( pushPath ( '/baz' ) )
502+ expect ( updates ) . toEqual ( [ '/' , '/bar' , '/baz' ] )
501503
502504 historyUnsubscribe ( )
503505 } )
504506
505507 it ( 'only triggers store once when updating path via store' , ( ) => {
506508 const updates = [ ]
507509 const storeUnsubscribe = store . subscribe ( ( ) => {
508- updates . push ( store . getState ( ) . routing . path ) ;
510+ updates . push ( store . getState ( ) . routing . path )
509511 } )
510512
511- store . dispatch ( pushPath ( '/bar' ) ) ;
512- store . dispatch ( pushPath ( '/baz' ) ) ;
513- store . dispatch ( replacePath ( '/foo' ) ) ;
514- expect ( updates ) . toEqual ( [ '/bar' , '/baz' , '/foo' ] )
513+ store . dispatch ( pushPath ( '/bar' ) )
514+ store . dispatch ( pushPath ( '/baz' ) )
515+ store . dispatch ( replacePath ( '/foo' ) )
516+ expect ( updates ) . toEqual ( [ '/bar' , '/baz' , '/foo' ] )
515517
516518 storeUnsubscribe ( )
517519 } )
@@ -529,7 +531,7 @@ module.exports = function createTests(createHistory, name, reset = defaultReset)
529531 path : '/bar'
530532 } )
531533
532- history . pushState ( undefined , '/baz' ) ;
534+ history . pushState ( undefined , '/baz' )
533535 expect ( store ) . toContainRoute ( {
534536 path : '/baz'
535537 } )
0 commit comments