【发布时间】:2020-01-01 09:42:55
【问题描述】:
我正在尝试为扩展基类的组件编写单元测试。
component.ts
export class DesktopPresentationAreaComponent extends AbstractPresentationComponent {
constructor() {
super(store, webcast);
}
}
基类
export abstract class AbstractPresentationComponent {
constructor(protected store: MainStorageService,
protected webcast: WebcastService) {
this.store.get('state').subscribe();
}
当我运行“ng test”时,它显示以下错误。
TypeError: Cannot read property 'subscribe' of undefined in AbstractPresentationComponent
我该如何解决这个问题?
【问题讨论】: