Skip to content

Commit 4a91b68

Browse files
committed
test: fix failing tests
1 parent de8da88 commit 4a91b68

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

__tests__/router.spec.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ describe('Router', () => {
763763

764764
describe('Dynamic Routing', () => {
765765
it('resolves new added routes', async () => {
766-
const { router } = await newRouter()
766+
const { router } = await newRouter({ routes: [] })
767767
expect(router.resolve('/new-route')).toMatchObject({
768768
name: undefined,
769769
matched: [],
@@ -793,7 +793,7 @@ describe('Router', () => {
793793
})
794794

795795
it('can redirect to children in the middle of navigation', async () => {
796-
const { router } = await newRouter()
796+
const { router } = await newRouter({ routes: [] })
797797
expect(router.resolve('/new-route')).toMatchObject({
798798
name: undefined,
799799
matched: [],
@@ -849,7 +849,7 @@ describe('Router', () => {
849849
})
850850

851851
it('can reroute to child', async () => {
852-
const { router } = await newRouter()
852+
const { router } = await newRouter({ routes: [] })
853853
router.addRoute({
854854
path: '/new',
855855
component: components.Foo,
@@ -890,7 +890,9 @@ describe('Router', () => {
890890
})
891891

892892
it('stops resolving removed routes', async () => {
893-
const { router } = await newRouter()
893+
const { router } = await newRouter({
894+
routes: [routes.find(route => route.name === 'Foo')!],
895+
})
894896
// regular route
895897
router.removeRoute('Foo')
896898
expect(router.resolve('/foo')).toMatchObject({

0 commit comments

Comments
 (0)