Testing Angular component with unsubscribe Error during cleanup of component

后端 未结 10 1646
梦毁少年i
梦毁少年i 2021-01-30 10:37

I\'m testing a component which subscribe router params. Every test pass and everything works fine. But if I look in the console, I can see an error:

Error

10条回答
  •  伪装坚强ぢ
    2021-01-30 11:02

    In my case destroying the component after each test solved the problem. So you could try adding this to your describe function:

    afterEach(() => {
      fixture.destroy();
    })
    

提交回复
热议问题