{ path: '/foo', component: components.Foo, name: 'Foo' },
// prevent the log of no match warnings
{ path: '/:pathMatch(.*)', component: components.Home },
+ { path: '/async', component: () => Promise.reject('failed') },
]
const onError = jest.fn()
)
})
+ it('lazy loading reject', async () => {
+ await testError(true, 'failed', '/async')
+ })
+
it('Duplicated navigation triggers afterEach', async () => {
let expectedFailure = expect.objectContaining({
type: NavigationFailureType.duplicated,
async function testError(
nextArgument: any | NavigationGuard,
- expectedError: Error | void = undefined,
+ expectedError: any = undefined,
to: RouteLocationRaw = '/foo'
) {
const { router } = createRouter()