简体   繁体   English

如何在angular-redux / store中初始化根存储以进行测试?

[英]How to initialize root store in angular-redux/store for testing?

I want to set the initial root Store for angular redux instead of calling getSelectorStub for one selector at a time. 我想为角度还原设置初始根存储,而不是一次为一个选择器调用getSelectorStub What's the best way to do this? 最好的方法是什么?

StoreModule.forRoot() contains an optional configuration object as input parameter. StoreModule.forRoot()包含一个可选配置对象作为输入参数。

 StoreModule.forRoot(reducers, {
      initialState: {} // <---- provide initial state
 }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Storybook中使用@ angular-redux / store测试Angular - Testing Angular with @angular-redux/store in Storybook 使用@ angular-redux / store测试@select装饰器 - Testing @select decorators with @angular-redux/store @angular-redux/store:如何为 redux 商店编写单元测试? - @angular-redux/store : How to write unit test for the redux store? 带有 angular-redux/store 的 angular Guard - angular guard with angular-redux/store 在升级到9.0和角度7后修复angular-redux / store - Fix angular-redux/store after upgrade to 9.0 and angular 7 如何单元测试从 angular 10 中的“@angular-redux/store”中选择? - how to unit test select from "@angular-redux/store" in angular 10? 测试 Angular 组件,该组件引入了一个派生自 @angular-redux/store 的“@select()”方法的 observable - Test Angular component that brings in an observable derived from @angular-redux/store's “@select()” method 带有ng2-redux的Angular 4.4测试服务(angular-redux) - Angular 4.4 testing service with ng2-redux (angular-redux) @angular-redux/store 尝试测试在用 @select() 装饰的属性上使用异步的组件 - 文档不存在 - @angular-redux/store trying to test component that uses async on a property decorated with @select() - documentation does not exist 如何使用angular-redux的redux-state-sync中间件? - How to use redux-state-sync middleware with angular-redux?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM