@@ -158,6 +158,7 @@ describe("createRoutes should", () => {
158
158
id : "someTHING" ,
159
159
all : "BaR/sOlId"
160
160
} ) ;
161
+ expect ( route . originalPath ) . toBe ( "foo/:id/*all" ) ;
161
162
} ) ;
162
163
163
164
test ( `validate path using match filters` , ( ) => {
@@ -182,19 +183,25 @@ describe("createRoutes should", () => {
182
183
path : "foo/:id?"
183
184
} ;
184
185
const routes = createRoutes ( routeDef ) ;
185
- expect ( routes [ 0 ] . originalPath ) . toBe ( "foo" ) ;
186
- expect ( routes [ 1 ] . originalPath ) . toBe ( "foo/:id" ) ;
186
+ expect ( routes [ 0 ] . pattern ) . toBe ( "/foo" ) ;
187
+ expect ( routes [ 0 ] . originalPath ) . toBe ( "foo/:id?" ) ;
188
+ expect ( routes [ 1 ] . pattern ) . toBe ( "/foo/:id" ) ;
189
+ expect ( routes [ 1 ] . originalPath ) . toBe ( "foo/:id?" ) ;
187
190
} ) ;
188
191
189
192
test ( `with a multiple paths` , ( ) => {
190
193
const routeDef = {
191
194
path : [ "foo/:id?" , "bar/:name?" ]
192
195
} ;
193
196
const routes = createRoutes ( routeDef ) ;
194
- expect ( routes [ 0 ] . originalPath ) . toBe ( "foo" ) ;
195
- expect ( routes [ 1 ] . originalPath ) . toBe ( "foo/:id" ) ;
196
- expect ( routes [ 2 ] . originalPath ) . toBe ( "bar" ) ;
197
- expect ( routes [ 3 ] . originalPath ) . toBe ( "bar/:name" ) ;
197
+ expect ( routes [ 0 ] . pattern ) . toBe ( "/foo" ) ;
198
+ expect ( routes [ 0 ] . originalPath ) . toBe ( "foo/:id?" ) ;
199
+ expect ( routes [ 1 ] . pattern ) . toBe ( "/foo/:id" ) ;
200
+ expect ( routes [ 1 ] . originalPath ) . toBe ( "foo/:id?" ) ;
201
+ expect ( routes [ 2 ] . pattern ) . toBe ( "/bar" ) ;
202
+ expect ( routes [ 2 ] . originalPath ) . toBe ( "bar/:name?" ) ;
203
+ expect ( routes [ 3 ] . pattern ) . toBe ( "/bar/:name" ) ;
204
+ expect ( routes [ 3 ] . originalPath ) . toBe ( "bar/:name?" ) ;
198
205
} ) ;
199
206
} ) ;
200
207
} ) ;
0 commit comments