我们想要测量 Angular 8 应用程序代码覆盖率。我们有一个用 selenium java 编写的 e2e 测试用例,它加载部署在浏览器中另一台机器上的 Angular 应用程序,并运行一些 e2e 测试用例集。问题是我如何测量 Angular 应用程序 javascript 代码覆盖率。
在高层,我可以想到一些使用 istanbul 来检测我的 Angular JavaScript 代码的机制。Istanbul 将通过在浏览器中加载应用程序来记录 selenium java 代码执行 e2e 测试用例时的代码覆盖率。
寻找详细步骤我如何做同样的事情。
我想取消 Angular 8 中 RXJS 效果中发出的 http 请求。
@Effect() getReport$ = this.action$.pipe(
ofType(ActionTypes.GET_WIDGET),
map(toPayload),
mergeMap(payload => {
return this.dashboardService.getReport(payload).pipe(
map(this.extractData),
switchMap(result => {
return observableOf(<ReceivedWidgetAction>{
type: ActionTypes.RECEIVED_WIDGET,
payload: result
});
}),
catchError((err: Response | any) => {
return this.handleReportError(err);
}));
}));
Run Code Online (Sandbox Code Playgroud)
请让我知道如何使用 Angular 8 执行相同操作。另请注意,我将无法使用切换映射,因为多个 Angular 组件将使用不同的有效负载调用此操作。
typescript ngrx-effects ngrx-store angular8 rxjs-observables
I am iterating over a series of list items. Items is having a property id and internal id. for each item I am creating a some operation which returns another object say BackendItem along with unique id. My goal is create a map of item id and BackendItem id.
items.steam()
.filter(item -> item.type ==1)
.map(item -> backendService.createBackendItem(item))
.map (backendItem -> backendItem.id)
Run Code Online (Sandbox Code Playgroud)
here i want to create a map of (item.id,backendItem.id) Which operator should i use ?