Asserting that a parent component exists in angular unit test

前端 未结 2 1023
一个人的身影
一个人的身影 2021-01-22 17:18

I have a top level component AppComponent and in it\'s template property it renders the element on the page. (

2条回答
  •  情话喂你
    2021-01-22 17:40

    You need to add the ChildComponent to your module:

      beforeEach(() => {
        TestBed.configureTestingModule({ declarations: [AppComponent, ChildComponent] });
      });
    

提交回复
热议问题