如何解决如何为this.store .pipeselectgetRoles,skip1,takeWhileroles => role && Roles.length> 0编写测试覆盖率
如何涵盖 此商店 。管( 选择(getRoles) 跳过(1), takeWhile(角色=>角色&&角色。长度> 0) ) .subscribe((roles:IRole [])=>(this.roles =角色)); 在以下代码段中
constructor(
private store: Store<IState>,private uiService: UiService,private translation: TranslationService
) {
this.store
.pipe(
select(getRoles),skip(1),takeWhile(roles => roles && roles.length > 0)//unable to cover
)
.subscribe((roles: IRole[]) => (this.roles = roles));//unable to cover
this.getRoletoEdit$ = this.store
.pipe(
select(getRoletoBeEdited),skip(1)
)
.subscribe((role: IRole) => (this.selectedRoletoEdit = role));
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。