File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -61,8 +61,8 @@ describe('Route class testing', () => {
6161 } ) ;
6262
6363 it ( 'should throw an error if target route is not found' , ( ) => {
64- const dummyRoute : Route = new Route ( '/dummy ' , 0 ) ;
65- expect ( routes . navigate ( dummyRoute ) ) . toThrowError ( ) ;
64+ const dummyRoute : Route = new Route ( '/error ' , 0 ) ;
65+ expect ( ( ) => routes . navigate ( dummyRoute ) ) . toThrowError ( ) ;
6666 } ) ;
6767 } ) ;
6868
Original file line number Diff line number Diff line change @@ -47,7 +47,6 @@ export class Routes {
4747 const currentRoute : Route = this . routeHistory [ this . current ] ;
4848 // Check if the new url is different from the current url
4949 const isNavigating = currentRoute . url !== url ;
50- console . log ( 'IsNavigating ' , isNavigating ) ;
5150 if ( isNavigating ) {
5251 // Check if current is not equal to routeHistory.length - 1 becuase if it doesnt, we need to rebuild history
5352 if ( this . current !== this . routeHistory . length - 1 ) {
@@ -102,7 +101,7 @@ export class Routes {
102101 ) ;
103102 // If the target route is not found, throw an error
104103 if ( targetIndex === - 1 ) {
105- throw Error ( 'Error at Routes.navigage: targetIndex is undefined' ) ;
104+ throw new Error ( 'Error at Routes.navigage: targetIndex is undefined' ) ;
106105 }
107106 // Calculate the difference in index between the current route and the target route
108107 const delta : number = targetIndex - this . current ;
You can’t perform that action at this time.
0 commit comments