无法在角度2中使用RouterTestingModule.withRoutes()进行单元测试

时间:2018-06-27 17:12:31

标签: angular unit-testing jasmine router

这是我的 app.routing.ts

   const updatedRoutes: Route[] = [  
   {    
   path: '',   
   children: [  
              {  
                path: '',    
                redirectTo: 'updatestatus',    
                pathMatch: 'full'    
               },    
              {  
                path: 'updates',    
                component: UpdaterComponent    
              },  
              {    
               path: 'updates/:Id',  
               component: UpdaterComponent  
             },    
             {   
                path: 'updatestatus',    
               component: StatusComponent  
             }    
         ]  
   }];  

export const ManagerRouting = RouterModule.forChild(updatedRoutes);

<router-outlet></router-outlet> router.component.ts(RouterComponent)

请让我知道如何为上述代码编写单元测试。

0 个答案:

没有答案