@@ -567,7 +567,7 @@ describe.each([
567567 it ( 'sets reqCtx.route to METHOD and path for static routes' , async ( ) => {
568568 // Prepare
569569 const app = new Router ( ) ;
570- let capturedRoute = '' ;
570+ let capturedRoute : string | null = null ;
571571 app . use ( async ( { reqCtx, next } ) => {
572572 await next ( ) ;
573573 capturedRoute = reqCtx . route ;
@@ -584,7 +584,7 @@ describe.each([
584584 it ( 'sets reqCtx.route to METHOD and pattern for dynamic routes' , async ( ) => {
585585 // Prepare
586586 const app = new Router ( ) ;
587- let capturedRoute = '' ;
587+ let capturedRoute : string | null = null ;
588588 app . use ( async ( { reqCtx, next } ) => {
589589 await next ( ) ;
590590 capturedRoute = reqCtx . route ;
@@ -598,10 +598,10 @@ describe.each([
598598 expect ( capturedRoute ) . toBe ( 'GET /users/:id' ) ;
599599 } ) ;
600600
601- it ( 'sets reqCtx.route to METHOD and requested path for unmatched routes' , async ( ) => {
601+ it ( 'sets reqCtx.route to null for unmatched routes' , async ( ) => {
602602 // Prepare
603603 const app = new Router ( ) ;
604- let capturedRoute = '' ;
604+ let capturedRoute : string | null = '' ;
605605 app . use ( async ( { reqCtx, next } ) => {
606606 await next ( ) ;
607607 capturedRoute = reqCtx . route ;
@@ -612,6 +612,6 @@ describe.each([
612612 await app . resolve ( createEvent ( '/nonexistent' , 'GET' ) , context ) ;
613613
614614 // Assess
615- expect ( capturedRoute ) . toBe ( 'GET /nonexistent' ) ;
615+ expect ( capturedRoute ) . toBeNull ( ) ;
616616 } ) ;
617617} ) ;
0 commit comments