How to test an Angular Resolver - Stack Overflow

I've recently added an Angular "resolver", but now trying to figure out how to write a s

I've recently added an Angular "resolver", but now trying to figure out how to write a spec test for it.

Currently, the test script fails on the 2nd test in appponent.ts with timeout error:

FAIL   app-client-web  apps/app-client-web/src/app/appponent.spec.ts (20.929 s)
AppComponent
  √ should have title 'app-client-web' (170 ms)
  × should create RouterOutlet with valid query parameters (5029 ms)
  √ should have RotuerOutlet be null with invalid query parameter (320 ms)
● AppComponent › should create RouterOutlet with valid query parameters
thrown: "Exceeded timeout of 5000 ms for a test.
Add a timeout value to this test to increase the timeout, 
if this is a long-running test. See ."
  • A sample of our routes (with resolve: { .. }):

    // shell.routes.ts
    import { Routes } from '@angular/router';
    //... (more import here)
    import { globalConfigResolver } from './resolvers/app-config.resolver';
    
    export const myShellRoutes: Routes = [
      {
        path: 'single',
        component: MyShellComponent,
        canActivate: [myRouteGuard],
        resolve: { appConfig: globalConfigResolver },
      },
    ];

    发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743761530a4502719.html

相关推荐

  • How to test an Angular Resolver - Stack Overflow

    I've recently added an Angular "resolver", but now trying to figure out how to write a s

    6天前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信