@@ -18,6 +18,7 @@ describe("route matching", () => {
1818 "/test/fooo" ,
1919 "/another/path" ,
2020 "/wildcard/**" ,
21+ "/**" ,
2122 ] ) ;
2223
2324 const compiledLookup = compileRouter ( router ) ;
@@ -39,7 +40,8 @@ describe("route matching", () => {
3940 ├── /another
4041 │ ├── /path ┈> [GET] /another/path
4142 ├── /wildcard
42- │ ├── /** ┈> [GET] /wildcard/**"
43+ │ ├── /** ┈> [GET] /wildcard/**
44+ ├── /** ┈> [GET] /**"
4345 ` ) ;
4446 } ) ;
4547
@@ -123,6 +125,15 @@ describe("route matching", () => {
123125 data : { path : "/wildcard/**" } ,
124126 params : { _ : "" } ,
125127 } ) ;
128+ // Root wildcard
129+ expect ( match ( "GET" , "/anything" ) ) . toMatchObject ( {
130+ data : { path : "/**" } ,
131+ params : { _ : "anything" } ,
132+ } ) ;
133+ expect ( match ( "GET" , "/any/deep/path" ) ) . toMatchObject ( {
134+ data : { path : "/**" } ,
135+ params : { _ : "any/deep/path" } ,
136+ } ) ;
126137 } ) ;
127138 }
128139
@@ -131,6 +142,7 @@ describe("route matching", () => {
131142 removeRoute ( router , "GET" , "/test/*" ) ;
132143 removeRoute ( router , "GET" , "/test/foo/*" ) ;
133144 removeRoute ( router , "GET" , "/test/foo/**" ) ;
145+ removeRoute ( router , "GET" , "/**" ) ;
134146 expect ( formatTree ( router . root ) ) . toMatchInlineSnapshot ( `
135147 "<root>
136148 ├── /test
0 commit comments