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', () => {
61
61
} ) ;
62
62
63
63
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 ( ) ;
66
66
} ) ;
67
67
} ) ;
68
68
Original file line number Diff line number Diff line change @@ -47,7 +47,6 @@ export class Routes {
47
47
const currentRoute : Route = this . routeHistory [ this . current ] ;
48
48
// Check if the new url is different from the current url
49
49
const isNavigating = currentRoute . url !== url ;
50
- console . log ( 'IsNavigating ' , isNavigating ) ;
51
50
if ( isNavigating ) {
52
51
// Check if current is not equal to routeHistory.length - 1 becuase if it doesnt, we need to rebuild history
53
52
if ( this . current !== this . routeHistory . length - 1 ) {
@@ -102,7 +101,7 @@ export class Routes {
102
101
) ;
103
102
// If the target route is not found, throw an error
104
103
if ( targetIndex === - 1 ) {
105
- throw Error ( 'Error at Routes.navigage: targetIndex is undefined' ) ;
104
+ throw new Error ( 'Error at Routes.navigage: targetIndex is undefined' ) ;
106
105
}
107
106
// Calculate the difference in index between the current route and the target route
108
107
const delta : number = targetIndex - this . current ;
You can’t perform that action at this time.
0 commit comments