我正在尝试使用 RXJS 在 Angular 8 中使用 jest 创建单元测试。我想模拟商店。我正在使用https://ngrx.io/guide/store/testing使用模拟选择器的示例。谁能帮助我如何使用 MemoizedSelector 和 MockStore 独立使用模拟商店。
this.store.select(homeState).pipe(select(s => s.checkStatus)).subscribe(status => {
console.log(status);
// We performation other action.
});
Run Code Online (Sandbox Code Playgroud)
我在这个组件中有很多选择器。如何模拟许多选择器并更新每个测试用例的选择器值?