.detectChanges() not working within Angular test

前端 未结 4 705
梦毁少年i
梦毁少年i 2021-02-07 09:23

I\'ve been tasked with writing tests for a chat app developed with Angular. Below is the snippet of Angular template code I\'m currently writing tests for:



        
4条回答
  •  迷失自我
    2021-02-07 09:36

    In my case due to async loading I needed to use fixture.whenStable not just fixture.detectChanges e.g.

    it('test description', async(async () => {
    
        await fixture.whenStable();
    }));
    

提交回复
热议问题