をスパイするためにそれを割り当てる方法:ストアを取得し、私は2つのファイルを持っている変数
store$: Store<DogsStore>;
constructor(private store: Store<DogsStore>) {
this.store$ = store;
}
x.component.tsをx.componentとx.service
x.service.ts
constructor(private xService: X) {}
ngOnInit() {
this.xService.store$.select('something').subscribe(...)
}
テストx.component
cannot subscribe of undefined
というエラーが表示されます。 x.spec.ts
では私はあなたが私がstore$: Store<DogsStore> = new Store()
ようなものを使用することはできませんので、私はそれを初期化できませんでした見ることができるように私は
store$: Store<DogsStore>;
を持ってx.service.spy.tsを使用しています。ストアを取得して変数に割り当てるにはどうすればよいですか?多分それには別の問題がありますか?