How to unit test a Angular 4 component which uses router.paramMap

后端 未结 5 857
星月不相逢
星月不相逢 2021-02-19 05:48

I m new to angular 4 and trying to test one of the angular 4 feature router.paramMap from unit tests, Reading route params in fallowing way and working as expected in my applica

5条回答
  •  野的像风
    2021-02-19 06:29

    we're currently using this:

        { provide: ActivatedRoute, useValue: { 'params': Observable.from([{ 'id': '1'}]) } },
    

提交回复
热议问题