0
처음으로 각도 2 테스트를 시도하고 있습니다.각도 2 테스트에서 DegugElement가 정의되지 않았습니다.
let component: AlertButtonComponent;
let fixture: ComponentFixture<AlertButtonComponent>;
let de:DebugElement;
it('should have an H1 tag of `Alert Button`' ,() => {
console.log('debug element',de)
expect(de.query(By.css('h1')).nativeElement.innerText).toBe('lert Button')
})
나는 또한 오류 typeError: Cannot read property 'query' of undefined
을 얻고있다 드는 undefined
입니다.
여기
new DebugElement(); 작동 안됨. – raju
@raju - 각도의 링크를 확인하십시오. 일부 정보를 놓친 링크를 확인하고 여기에 내용을 포함하십시오. –
@raju -이 라인 고정 장치를 놓친 지점 = TestBed.createComponent (BannerComponent);는 –