@@ -21,6 +21,7 @@ const routes: RouteRecordRaw[] = [
21
21
{ path : '/foo' , component : components . Foo , name : 'Foo' } ,
22
22
// prevent the log of no match warnings
23
23
{ path : '/:pathMatch(.*)' , component : components . Home } ,
24
+ { path : '/async' , component : ( ) => Promise . reject ( 'failed' ) } ,
24
25
]
25
26
26
27
const onError = jest . fn ( )
@@ -52,6 +53,10 @@ describe('Errors & Navigation failures', () => {
52
53
)
53
54
} )
54
55
56
+ it ( 'lazy loading reject' , async ( ) => {
57
+ await testError ( true , 'failed' , '/async' )
58
+ } )
59
+
55
60
it ( 'Duplicated navigation triggers afterEach' , async ( ) => {
56
61
let expectedFailure = expect . objectContaining ( {
57
62
type : NavigationFailureType . duplicated ,
@@ -315,7 +320,7 @@ describe('isNavigationFailure', () => {
315
320
316
321
async function testError (
317
322
nextArgument : any | NavigationGuard ,
318
- expectedError : Error | void = undefined ,
323
+ expectedError : any = undefined ,
319
324
to : RouteLocationRaw = '/foo'
320
325
) {
321
326
const { router } = createRouter ( )
0 commit comments