const matcher = createRouterMatcher([], {})
matcher.addRoute({ path: '/', component, name: 'home' })
matcher.removeRoute('home')
+ expect(matcher.getRoutes()).toHaveLength(0)
expect(matcher.resolve({ path: '/' }, currentLocation)).toMatchObject({
name: undefined,
matched: [],
],
})
+ expect(matcher.getRoutes()).toHaveLength(2)
matcher.removeRoute('child')
+ expect(matcher.getRoutes()).toHaveLength(1)
expect(matcher.resolve({ path: '/about' }, currentLocation)).toMatchObject({
name: undefined,
})
matcher.removeRoute('home')
+ expect(matcher.getRoutes()).toHaveLength(0)
expect(matcher.resolve({ path: '/about' }, currentLocation)).toMatchObject({
name: undefined,
})
matcher.removeRoute('home')
+ expect(matcher.getRoutes()).toHaveLength(0)
expect(matcher.resolve({ path: '/start' }, currentLocation)).toMatchObject({
name: undefined,
})
matcher.removeRoute('home')
+ expect(matcher.getRoutes()).toHaveLength(0)
;[
'/',
'/start',
matcher.removeRoute('child')
+ expect(matcher.getRoutes()).toHaveLength(2)
+
expect(matcher.resolve({ path: '/about' }, currentLocation)).toMatchObject({
name: undefined,
matched: [],