3
我有这种验证组件的方法,它调用另一个组件,它是ViewChild
。我正在使用组件中使用this.ViewChildComponent.someMethod();
在我试图测试的组件。我试图使用spyOn(viewChildComponent, 'someMethod').and.returnValue(true)
。 但它说this.ViewChildComponent.someMethod() is undefined
。我拥有提供者上的所有依赖项,例如ViewChildComponent
的服务。我甚至走了一步,并呼吁viewChildComponent
使其服务决定someMethod();
测试使用Jasmine从viewChild调用另一个方法的方法
任何帮助将是非常棒的。
要简明扼要我想知道如何履行扶养ViewChild – HarmonicaBlower