Angular testing router params breaks test bed

后端 未结 3 1295
忘掉有多难
忘掉有多难 2021-02-06 21:58

When I provide params to my TestComponent the test bed blows up if the html contains a [routerLink]

testbed setup



        
3条回答
  •  有刺的猬
    2021-02-06 22:43

    You can add snapshot property inside your providers array.

    providers: [{ provide: ActivatedRoute, useValue: { snapshot: {} } }]
    

提交回复
热议问题