@@ -158,6 +158,7 @@ describe('Matcher: adding and removing records', () => {
158
158
const matcher = createRouterMatcher ( [ ] , { } )
159
159
matcher . addRoute ( { path : '/' , component, name : 'home' } )
160
160
matcher . removeRoute ( 'home' )
161
+ expect ( matcher . getRoutes ( ) ) . toHaveLength ( 0 )
161
162
expect ( matcher . resolve ( { path : '/' } , currentLocation ) ) . toMatchObject ( {
162
163
name : undefined ,
163
164
matched : [ ] ,
@@ -200,7 +201,9 @@ describe('Matcher: adding and removing records', () => {
200
201
] ,
201
202
} )
202
203
204
+ expect ( matcher . getRoutes ( ) ) . toHaveLength ( 2 )
203
205
matcher . removeRoute ( 'child' )
206
+ expect ( matcher . getRoutes ( ) ) . toHaveLength ( 1 )
204
207
205
208
expect ( matcher . resolve ( { path : '/about' } , currentLocation ) ) . toMatchObject ( {
206
209
name : undefined ,
@@ -230,6 +233,7 @@ describe('Matcher: adding and removing records', () => {
230
233
} )
231
234
232
235
matcher . removeRoute ( 'home' )
236
+ expect ( matcher . getRoutes ( ) ) . toHaveLength ( 0 )
233
237
234
238
expect ( matcher . resolve ( { path : '/about' } , currentLocation ) ) . toMatchObject ( {
235
239
name : undefined ,
@@ -249,6 +253,7 @@ describe('Matcher: adding and removing records', () => {
249
253
} )
250
254
251
255
matcher . removeRoute ( 'home' )
256
+ expect ( matcher . getRoutes ( ) ) . toHaveLength ( 0 )
252
257
253
258
expect ( matcher . resolve ( { path : '/start' } , currentLocation ) ) . toMatchObject ( {
254
259
name : undefined ,
@@ -283,6 +288,7 @@ describe('Matcher: adding and removing records', () => {
283
288
} )
284
289
285
290
matcher . removeRoute ( 'home' )
291
+ expect ( matcher . getRoutes ( ) ) . toHaveLength ( 0 )
286
292
; [
287
293
'/' ,
288
294
'/start' ,
@@ -325,6 +331,8 @@ describe('Matcher: adding and removing records', () => {
325
331
326
332
matcher . removeRoute ( 'child' )
327
333
334
+ expect ( matcher . getRoutes ( ) ) . toHaveLength ( 2 )
335
+
328
336
expect ( matcher . resolve ( { path : '/about' } , currentLocation ) ) . toMatchObject ( {
329
337
name : undefined ,
330
338
matched : [ ] ,
0 commit comments